1.引入
Vue.prototype.$ bus = Vue. prototype.$ bus||new Vue():
2.定义方法
this.$ bus.$ on(“methods”,id=>{})
3.方法的调用
this.$ bus.$ emit(“methods”,data)
vue的$bus的使用
最新推荐文章于 2024-05-22 11:17:14 发布
1.引入
Vue.prototype.$ bus = Vue. prototype.$ bus||new Vue():
2.定义方法
this.$ bus.$ on(“methods”,id=>{})
3.方法的调用
this.$ bus.$ emit(“methods”,data)