VUE组件如何通信

 Vue父子组件如何通信?

子组件通知父组件(调用父组件方法)

在父组件使用 on(eventName)监听事件,在子组件使用emit(eventName) 触发事件 ;

父组件通知子组件(调用子组件方法)

在父组件中,

<v-moneyInput v-model='hwData.A2' ref='A2'></v-moneyInput>

如上是父组件中的子组件,通过给一个ref属性,然后我们可以在父组件的方法中通过this.refs.A2.childMethod()调用子组件的childMethod方法。

https://blog.csdn.net/qq_33203555/article/details/77853201 vue组件间通信

使用VUE-CLI脚手架,搭建一个简单to-do-list项目  https://www.jianshu.com/p/1e2d81681af7

https://blog.csdn.net/wy6250000/article/details/83793400   Vue.js 父子组件通信的十种方式

原文地址:https://www.cnblogs.com/shy1766IT/p/10991682.html