摘要: 应用场景:两个页面共用同一部分表单,常规来说 切换路由表单要清空。但是由于是共用的 所以没有效果。 这时就可以监听路由改变,执行重置方法。 watch: { '$route' (to, from) { this.onReset(); } }, 阅读全文
posted @ 2020-11-06 16:34 伟笑 阅读(769) 评论(0) 推荐(0) 编辑
摘要: this.type = this.issuspected == 1 ? 0 : 1; this.issuspected == 1 ? this.type=0 : this.type=1 以上两个等同。。 阅读全文
posted @ 2020-10-29 15:15 伟笑 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 参考: https://blog.csdn.net/agua001/article/details/107960393 注意:该方法要写在methods里面,不能写在computed里。 阅读全文
posted @ 2020-10-13 10:44 伟笑 阅读(4618) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/spfLinux/article/details/79283513?utm_source=blogxgwz7 阅读全文
posted @ 2020-10-12 18:08 伟笑 阅读(1415) 评论(0) 推荐(0) 编辑
摘要: 本案例结合vant组件实现。思路是一样的。 关键词:Vue-2,checkbox的disabled属性和change事件,v-if判断 template: <van-checkbox-group v-model="isChe" @change="checkboxChange()"> <van-che 阅读全文
posted @ 2020-09-19 16:10 伟笑 阅读(1768) 评论(0) 推荐(0) 编辑
摘要: 表格数据宽度自适应方案。网上的有点麻烦,简单的就是让超出出现提示。 <el-table class="table" :data="Data" border stripe height="322" width="100%"> <el-table-column prop="jzmc" show-over 阅读全文
posted @ 2020-09-15 11:48 伟笑 阅读(845) 评论(0) 推荐(0) 编辑
摘要: 1、grid:调整视图在容器中位置,类似于调整上下左右padding ; grid: { top: '15%', bottom: '20%', right: '5%', left: '5%' }, 2、当X轴文本过长,文本斜着显示,倾斜 xAxis: { type: "category", axis 阅读全文
posted @ 2020-09-14 11:37 伟笑 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 对象解构: https://www.jianshu.com/p/fed61b907ab5 数组解构: https://www.jianshu.com/p/a8f74b29d0d1 阅读全文
posted @ 2020-09-06 11:38 伟笑 阅读(121) 评论(0) 推荐(0) 编辑
摘要: map和forEach都用于遍历数组,forEach没有返回值。map返回值是新的数组。 <script> let arr = [ {title:'aaa',read:50}, {title:'bbb',read:50}, {title:'ccc',read:50} ]; let newArr = 阅读全文
posted @ 2020-09-05 11:22 伟笑 阅读(1906) 评论(0) 推荐(0) 编辑
摘要: 父级 prop 的更新会向下流动到子组件中,但是反过来则不行。 每次父级组件发生变更时,子组件中所有的 prop 都将会刷新为最新的值。这意味着你不应该在一个子组件内部改变 prop。 vue 官网: https://cn.vuejs.org/v2/guide/components-props.ht 阅读全文
posted @ 2020-08-28 23:46 伟笑 阅读(5399) 评论(0) 推荐(0) 编辑