起因:
在列表中我点击编辑按钮使用深拷贝准备把当前点击行的数据重新赋值给el-dialog里面的表单后,发现input输入框无法输入
import { ref, onMounted, reactive } from 'vue'
let ruleForm = reactive ({
username: '',
password: '',
confirmPwd: '',
role: 2,
introduction: ''
})
//点击某一些进行编辑
const edit = (row) => {
ruleForm=JSON.parse(JSON.stringify(row))
dialogVisible.value = true
}
结果:
把reactive替换为ref 就好了
let ruleForm = ref ({
username: '',
password: '',
confirmPwd: '',
role: 2,
introduction: ''
})
//点击某一些进行编辑
const edit = (row) => {
ruleForm.value=JSON.parse(JSON.stringify(row))
dialogVisible.value = true
}