From 0fca81b35008a62615427c1715dd6ddde902fe6c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 17 Mar 2023 14:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=A1=B5=E7=AD=BE=E5=90=8E?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=85=B6=E4=BB=96=E9=A1=B5=E7=AD=BE=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=BA=94=E8=AF=A5=E8=B7=B3=E8=BD=AC=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/tab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/tab.js b/src/plugins/tab.js index fd3d286..407f634 100644 --- a/src/plugins/tab.js +++ b/src/plugins/tab.js @@ -32,8 +32,12 @@ export default { // 关闭指定tab页签 closePage(obj) { if (obj === undefined) { - return useTagsViewStore().delView(router.currentRoute.value).then(({ lastPath }) => { - return router.push(lastPath || '/index'); + return useTagsViewStore().delView(router.currentRoute.value).then(({ visitedViews }) => { + const latestView = visitedViews.slice(-1)[0] + if (latestView) { + return router.push(latestView.fullPath) + } + return router.push('/'); }); } return useTagsViewStore().delView(obj);