Sai Karthik
Balancing the braces ...Reset HTML Forms Using Vue Refs
Vue refs come handly when we want to access DOM elements directly. You can read more about vue refs here
In this case, we want to reset a form. So, let’s assign a html attribute named ref to a <form>
tag
A simple example:
|
|
Now we can apply DOM methods to an element like reset()
on this form by calling this.$refs.myForm.reset()
Share via:
Email
|
Tags: vue