Implementation process
First of all, came to the Element's official website, find the bottom part of the Form Methods Form Form provided
[Note] here is not necessary, you can directly see the following implementation steps
resetFields reset of the entire form, resets all field values and the initial value of the verification results removed
Then, we started working to achieve it
The first step: get a reference to an object
Add in from the ref="loginFormRef"
(loginFormRef custom name), then you can get the form to form by this instance it
ref DOM element is used to register the reference information or subassemblies. Reference information will be registered under $ refs object's parent component. If you use on a regular DOM elements, references to information that is elemental; if used in sub-assemblies, reference information is a component instance
Note: Whenever you want to directly manipulate DOM elements in Vue, it must be registered with the ref attribute
Step Two: Write Click event method
This completes
Knowledge supplement
- resetFields
- and $ ref ref