From 56563b4f8e5b48f54fb5fc05edcf9af7ee55a859 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期四, 16 六月 2022 11:47:10 +0800
Subject: [PATCH] 修复关闭左侧标签报错问题

---
 src/store/modules/tagsView.js |   27 +++++++++++++++------------
 1 files 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 @@
         })
       },
       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
+        return new Promise(resolve => {
+          const index = this.visitedViews.findIndex(v => v.path === view.path)
+          if (index === -1) {
+            return
           }
-          const i = this.cachedViews.indexOf(item.name)
-          if (i > -1) {
-            this.cachedViews.splice(i, 1)
-          }
-          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])
         })
       }
     }

--
Gitblit v1.9.3