diff --git a/src/main.js b/src/main.js index 7a86861..f802403 100644 --- a/src/main.js +++ b/src/main.js @@ -18,10 +18,13 @@ moment.locale('zh-cn'); Vue.use(Vuex); // Vue.use(ViewUI); - +//实现了全局的事件总线对象 +Vue.prototype.bus = new Vue(); new Vue({ render: h => h(App), router, }).$mount('#app') + + diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 94b4c02..c1e6105 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -69,6 +69,12 @@ threePermissionList: [], } }, + mounted(){ + let that = this; + this.bus.$on('callBack', function () { + that.callBack(); + }) + }, created() { this.mHeight = window.screen.availHeight - 22; @@ -223,7 +229,19 @@ this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; this.$router.push({path:that.onePermissionList[0].subMenuList[0].resource}); }, - } + //账户管理页面回调方法 + callBack(){ + debugger + let that = this; + this.selectedMenu = "设置管理"; + this.selectedSubMenu = "账户管理"; + this.selectedItemName = this.onePermissionList[0].subMenuList[0].id; + this.$nextTick(()=>{ + that.$refs.menu.updateActiveName(); + }) + } + }, + }