1.$refs的使用场景
父组件调用子组件的方法,可以传递数据。
父组件:
<div id=app>
<child ref=child></child>
<button @click=getMyEvent>点击父组件</button>
<div>
[removed]
import ChildA from './child.vue'
export default{
components:{
ChildA
},
data(){
return {
msg:'我是父组件的数据'
}