正在显示
1 个修改的文件
包含
6 行增加
和
2 行删除
| @@ -32,8 +32,12 @@ export default { | @@ -32,8 +32,12 @@ export default { | ||
| 32 | // 关闭指定tab页签 | 32 | // 关闭指定tab页签 |
| 33 | closePage(obj) { | 33 | closePage(obj) { |
| 34 | if (obj === undefined) { | 34 | if (obj === undefined) { |
| 35 | - return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { | ||
| 36 | - return router.push(lastPath || '/'); | 35 | + return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => { |
| 36 | + const latestView = visitedViews.slice(-1)[0] | ||
| 37 | + if (latestView) { | ||
| 38 | + return router.push(latestView.fullPath) | ||
| 39 | + } | ||
| 40 | + return router.push('/'); | ||
| 37 | }); | 41 | }); |
| 38 | } | 42 | } |
| 39 | return store.dispatch('tagsView/delView', obj); | 43 | return store.dispatch('tagsView/delView', obj); |
-
请 注册 或 登录 后发表评论