Vue Ref Form

Posted on  by admin
Refs are Vue.js instance properties that are used to indicate a reference to HTML elements or child elements in the template of your application.

One can access the DOM element directly using ref attribute to an HTML element. it is a read-only attribute and returns an object. The ref attribute makes a DOM element selectable by serving as the key in the parent $ref attribute.

Using a ref attribute in an input element, one can access parent DOM element as this.$refs.input, or you can say this.refs[“input”].

Let us know if you liked the post.

John Kary
6,246