事件总线(EventBus)

Vue.prototype.$EventBus = new Vue()

不建议用,尽量用vuex,eventbus过于消耗浏览器资源

傻瓜版状态管理

一般的状态传递是在同时显示的情况下,倘若是在不同时显示的情况下要处理好先后顺序

一定要记住在组件中销毁eventbus事件

https://www.w3cplus.com/vue/event-bus.html

https://blog.csdn.net/q3254421/article/details/82927860

 

posted @ 2019-09-11 10:34  雨打芭蕉wt  阅读(350)  评论(0编辑  收藏  举报