vue中eventbus 多次触发的问题

vue组件中使用bus来监听的时候回触发多次,解决办法, 就是在监听的组件的 beforeDestroy钩子中

 
1 beforeDestroy () {
2     this.$bus.$off('add',this.handle)
3   },

 

https://www.cnblogs.com/xiaochongchong/p/8127148.html

posted @ 2019-03-01 16:39  甜土豆  阅读(794)  评论(0编辑  收藏  举报