From 10393c4ab47424e950c52f3f7f2b0a41f11a8e8d Mon Sep 17 00:00:00 2001 From: fanxingqiang Date: Sat, 18 Aug 2018 18:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=AD=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/main/components/tags-nav/tags-nav.vue | 2 +- src/view/main/main.vue | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/view/main/components/tags-nav/tags-nav.vue b/src/view/main/components/tags-nav/tags-nav.vue index 8c947e65a..24e948dc0 100644 --- a/src/view/main/components/tags-nav/tags-nav.vue +++ b/src/view/main/components/tags-nav/tags-nav.vue @@ -101,7 +101,7 @@ export default { } else { // 关闭除当前页和home页的其他页 let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === 'home') - this.$emit('on-close', res, 'others') + this.$emit('on-close', res, 'others', this.currentRouteObj) setTimeout(() => { this.getTagElementByName(this.currentRouteObj.name) }, 100) diff --git a/src/view/main/main.vue b/src/view/main/main.vue index 443709ce1..c73163a4d 100644 --- a/src/view/main/main.vue +++ b/src/view/main/main.vue @@ -119,10 +119,13 @@ export default { this.turnToPage('home') openName = 'home' } else if (routeEqual(this.$route, route)) { - const nextRoute = getNextRoute(this.tagNavList, route) - this.$router.push(nextRoute) - if (type === 'other') openName = route.name - else openName = nextRoute.name + if (type === 'others') { + openName = route.name + } else { + const nextRoute = getNextRoute(this.tagNavList, route) + this.$router.push(nextRoute) + openName = nextRoute.name + } } this.setTagNavList(res) this.$refs.sideMenu.updateOpenName(openName)