// eventBus.js import Vue from 'vue' export default new Vue()
// 组件A触发事件 'aaaaaa' import bus from "@/assets/eventBus.js" bus.$emit('aaaaaa') //适当位置触发
// 组件B监听并执行相关code import bus from "@/assets/eventBus.js" created() { bus.$on('aaaaaa', () => { console.log('sfadfasdfaf'); this.sortBoardShow = false; }) }, // 注意在created钩子里面定义监听code