当前位置:网站首页>$refs: get the element object or sub component instance in the component:

$refs: get the element object or sub component instance in the component:

2022-07-07 07:10:00 To be a woman of light

1. In some cases , We want to get the element object or sub component instance directly in the component :

  •   stay Vue In development, we are ... is not recommended DOM operation Of ;
  • At this time , We can Bind an element or component with a ref Of attribute attribute ;

The component instance has a $refs attribute :

He has an object Object, Hold the registration ref attribute All of the DOM Element and component instances ;

 

原网站

版权声明
本文为[To be a woman of light]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070312311697.html