1.4.1
window7 64 chrom 58.0.3029.110
2.4.2
https://jsfiddle.net/pj71jkyw/436/
1.点击table中的第一行编辑数据后关闭dialog,执行resetFields()方法
2.点击table中的第二行编辑数据后关闭dialog,执行resetFields()方法,第二行数据会被初始化成第一行数据
Multiple use of resetFields () will not be initialized to the initial selected data
多次使用resetFields() 后 不会被初始化为初始选择的数据
Will be initialized to the initial data
会被初始化为初始的数据
Translation of this issue:
1.4.1
Window7 64, chrom, 58.0.3029.110
2.4.2
https://jsfiddle.net/pj71jkyw/436/
Click on the first line of table to the edit the data and close the dialog execute the resetFields () method
"Click line, on, the, second, of, the, table, edit, the, data, and, the, dialog, execute, the, resetFields (), method, and, the, second, line, of, data, will,, be, initialized,, to, close, the, to, first, row, data, of."
Multiple, use, of, resetFields (), will, not, be, initialized, to, the,, initial, selected, data
Multiple use of resetFields () will not be initialized to the initial selection of data
Will, be, initialized, to, the, initial, data
Will be initialized to the initial data
resetFields 会把表单回退为第一次被赋值的状态,所以在 el-form 上加一个
v-if,每次强制重新创建即可:https://jsfiddle.net/pj71jkyw/438/
这个resetFields 在dialog的form中,竟然也不是重置到data中定义的初始值,有点怪怪的感觉
试了一下,@zhang463291046 的方案是可行的,在我的场景下,@Leopoldthecoder 的方案也没有管用
感谢 @zhang463291046
Most helpful comment
解决方案https://jsfiddle.net/zhangjianliang/b47oyk23/1/