vue使用bus进行组件通信
EventBus事件总线
简单使用
全局注册
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.prototype.$EventBus = new Vue()
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
组件A
created (
原创
2022-04-28 17:09:39 ·
596 阅读 ·
0 评论