Fork me on GitHub
摘要: //安装: npm install vue-bus1. // app.js var eventBus = { install(Vue,options) { Vue.prototype.$bus = new Vue() } }; Vue.use(eventBus); 2.然后在组件中,可以使用$emit, $on, $off 分别来分发、监听、取消... 阅读全文
posted @ 2019-08-17 09:43 欢欢11 阅读(541) 评论(0) 推荐(0) 编辑