Commit 7a090bda authored by Giovanni's avatar Giovanni
Browse files

关闭当前tab页应跳转最右侧tab页而非首页

parent 641e550d
...@@ -32,8 +32,12 @@ export default { ...@@ -32,8 +32,12 @@ export default {
// 关闭指定tab页签 // 关闭指定tab页签
closePage(obj) { closePage(obj) {
if (obj === undefined) { if (obj === undefined) {
return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
return router.push(lastPath || '/'); const latestView = visitedViews.slice(-1)[0]
if (latestView) {
return router.push(latestView.fullPath)
}
return router.push('/');
}); });
} }
return store.dispatch('tagsView/delView', obj); return store.dispatch('tagsView/delView', obj);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment