作者 若依
提交者 Gitee

!673 $tab.closePage后存在非首页页签时不应该跳转首页

Merge pull request !673 from Giovanni/master
@@ -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);