修复关闭其他报错

This commit is contained in:
fanxingqiang 2018-08-18 18:19:47 +08:00
parent 7193bc387c
commit 10393c4ab4
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)