From 56563b4f8e5b48f54fb5fc05edcf9af7ee55a859 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 16 Jun 2022 11:47:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=AD=E5=B7=A6?= =?UTF-8?q?=E4=BE=A7=E6=A0=87=E7=AD=BE=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/tagsView.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 34506a6..f8986d7 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -132,19 +132,22 @@ const useTagsViewStore = defineStore( }) }, delLeftTags(view) { - const index = this.visitedViews.findIndex(v => v.path === view.path) - if (index === -1) { - return - } - this.visitedViews = this.visitedViews.filter((item, idx) => { - if (idx >= index || (item.meta && item.meta.affix)) { - return true - } - const i = this.cachedViews.indexOf(item.name) - if (i > -1) { - this.cachedViews.splice(i, 1) + return new Promise(resolve => { + const index = this.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return } - return false + this.visitedViews = this.visitedViews.filter((item, idx) => { + if (idx >= index || (item.meta && item.meta.affix)) { + return true + } + const i = this.cachedViews.indexOf(item.name) + if (i > -1) { + this.cachedViews.splice(i, 1) + } + return false + }) + resolve([...this.visitedViews]) }) } }