VUE-From form validation reset

1. Description:

After the form is verified, click Cancel or Close, and open it again, the verification prompt will not disappear.

It is necessary to reset the form when clicking to open the form pop-up window or close the pop-up window

2. Method:

this.$refs.taskform.resetFields()

I called it when it was closed, (since my own is a sub-component, there will be a problem that the parameters cannot be found when the form is reset when clicking Add)

Due to different application scenarios, if closing the pop-up window and the cancel button in your own Form pop-up window are not the same method, you need to add the reset form method to both methods.

Guess you like

Origin blog.csdn.net/yang516114852/article/details/122928862