Skip to content

Commit

Permalink
Merge pull request #890 from LZHD/master
Browse files Browse the repository at this point in the history
修复点击关闭其他标签页报错
  • Loading branch information
Lison authored Aug 19, 2018
2 parents 7193bc3 + 10393c4 commit 597cf2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/view/main/components/tags-nav/tags-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions src/view/main/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 597cf2d

Please sign in to comment.