设计一个弹框,右击某行弹出且有初始值?-灵析社区

萌蒙萌

弹窗: item.prop !== 'usestate' && item.prop !== 'recordtime' )" > 取 消 确 定 右击鼠标,触发弹框,且将当前右击行的内容赋值给表单,作为初始值显示 rightClick(row, column, event) { this.openDialog(row); this.dialogFormVisible = true; }, resetForm() { this.$refs.ruleForm.resetFields(); }, openDialog(val) { this.editForm = val }, 弹窗弹出后,显示内容为初始值,但是点击内容编辑报错不能对未知对象渲染。存储表单的数据已经绑定到数据节点了,后来加了$nextTickt,也不对。 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241118/c345231197a4338b8d9305db485f7cfc.png)

阅读量:26

点赞量:0

问AI
生成头像
用深拷贝试试: rightClick(row, column, event) { this.openDialog(row); this.dialogFormVisible = true; }, resetForm() { this.$refs.ruleForm.resetFields(); }, openDialog(val) { this.$nextTick(() => { this.editForm = JSON.parse(JSON.stringify(val)); // 用深拷贝 }); },