摘要: 配置全局事件总线 在mian.js 内 new Vue({ beforeCreate(){ Vue.prototype.$bus = this // this 是当前Vue的实例对象 } }) A组件 和 B组件 实现组件通讯 在A组件中使用 mounted(){ this.$bus.$on('xx 阅读全文
posted @ 2021-11-12 10:48 想上天与太阳并肩 阅读(169) 评论(0) 推荐(0) 编辑