如图准备工作:

EventBus使用教程

父子(子父)组件触发

EventBus.$emit('sub') 

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

 

相关文章: