mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复开启keepAlive后点击标签页的重新加载,页面缓存还存在的问题
				
					
				
			This commit is contained in:
		
							parent
							
								
									f5617d5eb2
								
							
						
					
					
						commit
						09cbc7ddc3
					
				@ -169,6 +169,7 @@ function onFresh() {
 | 
				
			|||||||
    path: "/redirect" + fullPath,
 | 
					    path: "/redirect" + fullPath,
 | 
				
			||||||
    query
 | 
					    query
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					  handleAliveRoute(route as toRouteType, "refresh");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function deleteDynamicTag(obj: any, current: any, tag?: string) {
 | 
					function deleteDynamicTag(obj: any, current: any, tag?: string) {
 | 
				
			||||||
 | 
				
			|||||||
@ -270,6 +270,12 @@ function handleAliveRoute({ name }: toRouteType, mode?: string) {
 | 
				
			|||||||
        name
 | 
					        name
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
 | 
					    case "refresh":
 | 
				
			||||||
 | 
					      usePermissionStoreHook().cacheOperate({
 | 
				
			||||||
 | 
					        mode: "refresh",
 | 
				
			||||||
 | 
					        name
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
      usePermissionStoreHook().cacheOperate({
 | 
					      usePermissionStoreHook().cacheOperate({
 | 
				
			||||||
        mode: "delete",
 | 
					        mode: "delete",
 | 
				
			||||||
 | 
				
			|||||||
@ -24,13 +24,15 @@ export const usePermissionStore = defineStore({
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    cacheOperate({ mode, name }: cacheType) {
 | 
					    cacheOperate({ mode, name }: cacheType) {
 | 
				
			||||||
 | 
					      const delIndex = this.cachePageList.findIndex(v => v === name);
 | 
				
			||||||
      switch (mode) {
 | 
					      switch (mode) {
 | 
				
			||||||
 | 
					        case "refresh":
 | 
				
			||||||
 | 
					          this.cachePageList = this.cachePageList.filter(v => v !== name);
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
        case "add":
 | 
					        case "add":
 | 
				
			||||||
          this.cachePageList.push(name);
 | 
					          this.cachePageList.push(name);
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case "delete":
 | 
					        case "delete":
 | 
				
			||||||
          // eslint-disable-next-line no-case-declarations
 | 
					 | 
				
			||||||
          const delIndex = this.cachePageList.findIndex(v => v === name);
 | 
					 | 
				
			||||||
          delIndex !== -1 && this.cachePageList.splice(delIndex, 1);
 | 
					          delIndex !== -1 && this.cachePageList.splice(delIndex, 1);
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user