vue.use 与 vue.component

Error - 1 弹层对象取自列表,列表数据在弹层编辑修改,编辑部分数据后,取消或关闭弹层,列表数据修改。
产生原因:vue 双向绑定
解决办法:copy Object, 对象重新 copy 一份

1
2
3
4
5
6
7
8
9
handlerUpdate(item) {
// 更新 item
this.dialogVisible = !this.dialogVisible
this.dialogStatus = 'edit'
this.temp = Object.assign({}, item) // copy obj
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
},
1
const vm: Component = this

以上写是不是有点奇怪,是的。我没见过,它是 flow.js