//mounted中创建监听
mounted: function () {
eventBus.$on("node",this.busHandle)
},
//beforeDestroy中销毁监听
beforeDestroy: function () {
eventBus.$off('node', this.busHandle)
}
Vue EventBus 注意事项
最新推荐文章于 2024-05-15 10:00:00 发布
//mounted中创建监听
mounted: function () {
eventBus.$on("node",this.busHandle)
},
//beforeDestroy中销毁监听
beforeDestroy: function () {
eventBus.$off('node', this.busHandle)
}