el-form, item fills in the value validate and keeps reporting an error

After checking the bound form, rules, prop, and v-model, there is no problem. Finally, I found a solution after checking a lot of information. '

Reason: For example, in the case below, el-form-item is nested in el-form-item, the hierarchy is too deep, and form cannot detect the change of addform.
insert image description here
insert image description here

Solution:
1. In the change event, force update dom trigger (view update)

insert image description here this.$forceUpdate(); insert picture description here
insert image description here

2. In the change event, copy the data bound to the form form this.addForm = JSON.parse(JSON.stringify(this.addForm));or describe it like thisthis.addForm = { ...this.addForm };

insert image description here

Reference blog:
element-ui form verification, el-select verification failure problem

Guess you like

Origin blog.csdn.net/weixin_45288172/article/details/131173910