Question:

Cannot reset form entries using this.$ref[‘form’].resetfields ()

The reason:

1. The ref attribute is not added to the form

2. No prop attribute is added to the form item el-form-item. The prop attribute must be the same as that bound to the input box

3. When vuEX is used, new forms and edited forms are reused. In this case, the effect of clearing forms cannot be achieved even if the above attributes and methods are added.

Important: The resetField() method does not reset the form to empty, but to its original value

So when we open the new form, the value of the form item binding is empty. After submitting the form, the value of the form item binding is not empty. When we open the new form, the value of the form item binding is not empty.

The resetFields method is performed after the binding value is successfully submitted, and the resetFields method is performed after the property is reset, because the validation of the form rules may be triggered if the property is reset to null, and the resetFields method removes the validation result.