摘要: 你的form要满足如下形式才能够真正使用resetFields: Form 必须定义 ref 属性 From 必须绑定 model From 的 FormItem 中有 prop 属性 model 中绑定的属性与 prop 中相同 <Form ref="ruleForm" :model="ruleF 阅读全文
posted @ 2021-12-30 14:17 Fourteen 阅读(3367) 评论(0) 推荐(0) 编辑
摘要: 组件封装好,直接调用即可。 代码如下: /* * @desc: 滚动组件 */ <template> <div class="note-block" ref="noteBlocking" @mouseover="handStop" @mouseleave="handStart" v-show="no 阅读全文
posted @ 2021-12-15 15:28 Fourteen 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1.普通的监听 data() { return { msg: '' } }, watch: { msg(newValue, oldValue) { console.log(newValue) } } 2.对象属性的监听:可以通过配置 deep 为true实现。直接监听整个属性,消耗大 data() 阅读全文
posted @ 2021-09-29 11:03 Fourteen 阅读(3119) 评论(0) 推荐(0) 编辑
摘要: .p-overflow { width: 260px; //固定宽度 overflow: hidden; //超过隐藏 text-overflow: ellipsis;//省略号 white-space: nowrap; //不换行 } 阅读全文
posted @ 2021-08-31 10:47 Fourteen 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Vue通过prop进行双向数据绑定。子组件数据变化,一般只能通过 this.$emit(func, val) 回调父组件函数来传值给父组件。 Vue2.3版本引入sync,作为一个事件绑定语法糖,当子组件触发事件时,父组件会响应事件并实现数据更新。 .sync 修饰符 this.$emit('upd 阅读全文
posted @ 2021-08-26 10:27 Fourteen 阅读(1239) 评论(0) 推荐(0) 编辑
摘要: 输入框发生的事件流程依次为focus、keydown、input、keyup、change与blur,见下图所示。 阅读全文
posted @ 2021-08-13 10:10 Fourteen 阅读(332) 评论(0) 推荐(0) 编辑
摘要: //错误1 var a = [1,2] a.forEach(v => { if(true){ console.log(v) return } console.log("test")} ) var b = 3 console.log(b) //1 //2 //3 //错误2 var a = [1,2] 阅读全文
posted @ 2021-07-22 10:58 Fourteen 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 排查代码原因: 直接修改了state数据。 不要在mutation函数外修改VUEX存储状态。state里存储的数据只能通过mutations修改,不能直接修改数组或对象。 let accessInfoVo = _.get(storeMgr.storeState, 'baseInfo.accessI 阅读全文
posted @ 2021-07-09 16:11 Fourteen 阅读(1547) 评论(0) 推荐(0) 编辑
摘要: Object.assign()方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象。 返回目标对象。 1.复制一个对象。 const obj = { a: 1 }; const copy = Object.assign({}, obj); console.log(copy); // { a: 阅读全文
posted @ 2021-07-09 09:33 Fourteen 阅读(34) 评论(0) 推荐(0) 编辑
摘要: const {attr} = obj 等同于 const attr = obj.attr,是ES6用法。 //减少Cannot read property xxx of undefined 类型的错误 //万一你的obj是undefined,如果这样写const attr = obj.attr 就炸 阅读全文
posted @ 2021-06-30 16:54 Fourteen 阅读(103) 评论(0) 推荐(0) 编辑