Home  >  Article  >  Web Front-end  >  Usage of $refs in Vue

Usage of $refs in Vue

不言
不言Original
2018-06-25 15:09:482117browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn