Home > Article > Web Front-end > Usage of $refs in Vue
This article mainly introduces the usage of $refs in Vue. It is very good and has certain reference value. Friends in need can refer to it
Explanation: vm.$refs is an object that holds All subcomponents (or HTML elements) that have registered ref
Use: In the HTML element, add the ref attribute, and then obtain it through the vm.$refs. attribute in JS
Note: If you get a subcomponent, you can get the data and methods in the subcomponent through ref
Document
Hello, world!
The above is the entire content of this article, I hope it will be useful Everyone’s learning is helpful. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
vue-cli and webpack notepad project creation
About vue and vue-validator form verification Implementation of function
The above is the detailed content of Usage of $refs in Vue. For more information, please follow other related articles on the PHP Chinese website!