diff --git a/web/src/view/layout/aside/historyComponent/history.vue b/web/src/view/layout/aside/historyComponent/history.vue index 835ac9a988d2004c80169e6e8a75ecc0f981d8ac..06abb4a85a262ff29ae098ab5f47b7cd06382580 100644 --- a/web/src/view/layout/aside/historyComponent/history.vue +++ b/web/src/view/layout/aside/historyComponent/history.vue @@ -16,9 +16,7 @@ :tab="item" class="gva-tab" > - + {{ item.meta.title }} @@ -109,7 +107,13 @@ export default { } this.setTab(this.$route) }, - + mounted(){ + //全局监听 关闭当前页面函数 + this.$bus.on('closeThisPage', ()=>{ + const router = this.$route.path.split("/") + this.removeTab(`${router[router.length - 1]}`) + }) + }, beforeDestroy() { emitter.off('collapse') emitter.off('mobile') @@ -247,6 +251,7 @@ export default { }) }, removeTab(tab) { + console.log(tab) const index = this.historys.findIndex( item => getFmtString(item) === tab ) diff --git a/web/src/view/layout/index.vue b/web/src/view/layout/index.vue index 60a85a9b44eb922a53f74f6c7f58a7a1c0602577..8eef7cd88029cd735ee110a524ed5eecdca95080 100644 --- a/web/src/view/layout/index.vue +++ b/web/src/view/layout/index.vue @@ -75,7 +75,7 @@ - +