main.js 引用
Vue.prototype.$eventHub = Vue.prototype.$eventHub || new Vue();
page.vue 监听事件
mounted() {
this.query.invalidFlag = 0;
this.display();
this.$eventHub.$on('eventName', this.display);
},
beforeDestroy() {
this.$eventHub.$off('eventName');
},
action.vue 触发事件
this.$eventHub.$emit('eventName', '');
---END---