Vue父子组件如何通讯?vue
子组件通知父组件(调用父组件方法)this
在父组件使用 on(eventName)监听事件,在子组件使用emit(eventName) 触发事件 ;.net
父组件通知子组件(调用子组件方法)blog
在父组件中,事件
<v-moneyInput v-model='hwData.A2' ref='A2'></v-moneyInput>it
如上是父组件中的子组件,经过给一个ref属性,而后咱们能够在父组件的方法中经过this.refs.A2.childMethod()调用子组件的childMethod方法。event
https://blog.csdn.net/qq_33203555/article/details/77853201 vue组件间通讯组件通信
使用VUE-CLI脚手架,搭建一个简单to-do-list项目 https://www.jianshu.com/p/1e2d81681af7model
https://blog.csdn.net/wy6250000/article/details/83793400 Vue.js 父子组件通讯的十种方式方法