1.4.0
window 10/chrome
2.3.3
https://jsfiddle.net/d3oLzth9/6/
点击编辑打开dialog赋予data里form的值后再点击添加按钮resetFields,无法用resetFields重置回form里面初始的值,
resetFields后初始的值不应该是data里最初始的值吗?
Translation of this issue:
1.4.0
Window 10/chrome
2.3.3
https://jsfiddle.net/d3oLzth9/6/
Click the edit, open dialog, assign the value of data in form, and then click the Add button resetFields, and you can't reset the initial value in form with resetFields,
Should the initial value not be the initial value in data after resetFields?
Dialog 中的内容是懒加载的,目前 edit
方法的写法导致 Form 刚加载出来时值就已经是新的了,所以 resetFields
也只能回到新值。用 nextTick
包一下就好:https://jsfiddle.net/d3oLzth9/8/
这个问题搞哭了 先编辑再添加就重置失败 呜呜
nextTick方式解决了
再问个问题 @Leopoldthecoder 为什么第一次调用resetFields时控制台会报错 为什么第二次就不会了 怎么解决这个问题
Most helpful comment
Dialog 中的内容是懒加载的,目前
edit
方法的写法导致 Form 刚加载出来时值就已经是新的了,所以resetFields
也只能回到新值。用nextTick
包一下就好:https://jsfiddle.net/d3oLzth9/8/