Merge pull request #890 from LZHD/master

修复点击关闭其他标签页报错
This commit is contained in:
Lison 2018-08-19 14:18:57 +08:00 committed by GitHub
commit 597cf2d531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -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)

View File

@ -119,10 +119,13 @@ export default {
this.turnToPage('home')
openName = 'home'
} else if (routeEqual(this.$route, route)) {
if (type === 'others') {
openName = route.name
} else {
const nextRoute = getNextRoute(this.tagNavList, route)
this.$router.push(nextRoute)
if (type === 'other') openName = route.name
else openName = nextRoute.name
openName = nextRoute.name
}
}
this.setTagNavList(res)
this.$refs.sideMenu.updateOpenName(openName)