Ver código fonte

feat:全局添加事件总线

yangqishu 4 meses atrás
pai
commit
2e15bef2f0
1 arquivos alterados com 3 adições e 0 exclusões
  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')