1、若ref属性在普通dom元素上返回dom元素。

2、若ref也有在组件上,返回组件的示例。

 

<!-- `vm.$refs.p` will be the DOM node -->
<p ref="p">hello</p>

<!-- `vm.$refs.child` will be the child component instance -->
<child-component ref="child"></child-component>

 

相关文章: