|
|
@@ -32,8 +32,12 @@ export default {
|
|
32
|
32
|
// 关闭指定tab页签
|
|
33
|
33
|
closePage(obj) {
|
|
34
|
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
|
43
|
return store.dispatch('tagsView/delView', obj);
|