Browse Source

fix:关闭其它页签需要使用fullPath来判断,更新缓存后需要同时更新localStorage,否则刷新页面页签会再次加载 (#2847)

* fixed:修复操作页签后 打开页面需要使用fullPath,否则可能会导致参数丢失引起数据加载异常。

* fix:关闭其它页签需要使用fullPath来判断,更新缓存后需要同时更新localStorage,否则刷新页面页签会再次加载

---------

Co-authored-by: lichi <lichi@ilinecn.com>
Norton 1 year ago
parent
commit
a1283c1322
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/store/modules/multipleTab.ts

+ 2 - 1
src/store/modules/multipleTab.ts

@@ -308,7 +308,7 @@ export const useMultipleTabStore = defineStore({
 
       for (const path of closePathList) {
         if (path !== route.fullPath) {
-          const closeItem = this.tabList.find((item) => item.path === path);
+          const closeItem = this.tabList.find((item) => item.fullPath === path);
           if (!closeItem) {
             continue;
           }
@@ -320,6 +320,7 @@ export const useMultipleTabStore = defineStore({
       }
       this.bulkCloseTabs(pathList);
       this.updateCacheTab();
+      Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList, true)
       handleGotoPage(router);
     },