mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: 重置路由时,清空缓存页面
This commit is contained in:
		
							parent
							
								
									cef79dfca0
								
							
						
					
					
						commit
						3056527701
					
				@ -9,7 +9,6 @@ import { useResizeObserver, useDebounceFn } from "@vueuse/core";
 | 
			
		||||
import { useSettingStoreHook } from "/@/store/modules/settings";
 | 
			
		||||
import { handleAliveRoute, delAliveRoutes } from "/@/router/utils";
 | 
			
		||||
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
 | 
			
		||||
import { usePermissionStoreHook } from "/@/store/modules/permission";
 | 
			
		||||
import { ref, watch, unref, toRaw, nextTick, onBeforeMount } from "vue";
 | 
			
		||||
 | 
			
		||||
const {
 | 
			
		||||
@ -276,7 +275,6 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
 | 
			
		||||
        startIndex: 1,
 | 
			
		||||
        length: multiTags.value.length
 | 
			
		||||
      });
 | 
			
		||||
      usePermissionStoreHook().clearAllCachePage();
 | 
			
		||||
      router.push("/welcome");
 | 
			
		||||
      break;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -106,6 +106,7 @@ export function resetRouter() {
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  usePermissionStoreHook().clearAllCachePage();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 路由白名单
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,9 @@ export const usePermissionStore = defineStore({
 | 
			
		||||
    },
 | 
			
		||||
    // 清空缓存页面
 | 
			
		||||
    clearAllCachePage() {
 | 
			
		||||
      this.wholeMenus = [];
 | 
			
		||||
      this.menusTree = [];
 | 
			
		||||
      this.buttonAuth = [];
 | 
			
		||||
      this.cachePageList = [];
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user