[Bug Report] resetFields方法的重置值固定为第一次输入的表单内容/The reset value of the resetFields method is fixed to the first input of the form content
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Element UI version
2.15.14
### OS/Browsers version
win 10 / 版本 116.0.5845.111(正式版本) (64 位)
### Vue version
2.6.10
### Reproduction Link
https://github.com/XuDong422/element-resetFields-problem/tree/main
### Steps to reproduce
1.随机点击一个审核按钮
2.关闭对话框
3.再次随机点击一个非第一次点击的审核按钮
问题描述
问题出现在this.$refs['ref'].resetFields(),当我第一次点击获取row的settle_amount存入this.model.settle_amount,显示的settle_amount值是正确的,关闭对话框后再次随机点击另一个审核按钮,这时候显示的值是第一次点击获取row的settle_amount.
这不是显示问题,我将model字符串化log发现model中的settle_amount确实是第一次点击获取row的settle_amount.
当我注释this.$refs['ref'].resetFields()后,显示的都是最新row的settle_amount,实际model中的值也是正确的.我使用setTimeout延迟了this.$refs['ref'].resetFields()执行,发现确实是resetFields()将this.model.settle_amount的值重置为第一次点击获取row的settle_amount
1. Randomly click on an audit button
2. Close the dialog box
3. Randomly click on a non first click review button again
Problem Description
The problem appears in this$ Refs ['ref ']. resetFields(), when I first clicked to obtain the row's title_ Amount deposited into this. model. set_ Amount, displayed setting_ The amount value is correct. After closing the dialog box, randomly click another review button again, and the displayed value is the first time you click to obtain the row's title_ Amount
This is not a display issue. I will string the model into a log and find the setting in the model_ Amount is indeed the first time you have clicked to obtain the row's title_ Amount
When I annotate this$ After refs ['ref ']. resetFields(), the latest row's title is displayed_ Amount, the actual value in the model is also correct. I used setTimeout to delay this$ Refs ['ref ']. resetFields() was executed and it was found that it was indeed resetFields() that changed this. model. set_ Reset the value of amount to the first click to obtain the row's title_ Amount
### What is Expected?
model={
id: 0,
settle_amount: 0
}
### What is actually happening?
resetFields()后的model={
...
settle_amount: 第一次获取row的settle_amount / Obtaining the row's title for the first time_ Amount
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.