EventBus使用教程

如图准备工作:

父子(子父)组件触发

EventBus.$emit('sub') 

EventBus.$on('sub',()=>{
console.log(1111222232211122)
})

原文地址:https://www.cnblogs.com/xiaohuizhang/p/10875696.html