Browse Source

feat:全局添加事件总线

yangqishu 4 tháng trước cách đây
mục cha
commit
2e15bef2f0
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/main.js

+ 3 - 0
src/main.js

@@ -38,5 +38,8 @@ setRootFontSize('v')
 new Vue({
   router,
   store,
+  beforeCreate() {
+    Vue.prototype.$globalEventBus = this
+  },
   render: (h) => h(App)
 }).$mount('#app')