mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: showLink is false,children menu still showing
This commit is contained in:
		
							parent
							
								
									9c70c5a8dc
								
							
						
					
					
						commit
						c8e90b4bd7
					
				@ -13,9 +13,17 @@ export const usePermissionStore = defineStore({
 | 
				
			|||||||
  }),
 | 
					  }),
 | 
				
			||||||
  actions: {
 | 
					  actions: {
 | 
				
			||||||
    asyncActionRoutes(routes) {
 | 
					    asyncActionRoutes(routes) {
 | 
				
			||||||
 | 
					      const filterTree = data => {
 | 
				
			||||||
 | 
					        const newTree = data.filter(v => v.meta.showLink);
 | 
				
			||||||
 | 
					        newTree.forEach(
 | 
				
			||||||
 | 
					          v => v.children && (v.children = filterTree(v.children))
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return newTree;
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (this.wholeRoutes.length > 0) return;
 | 
					      if (this.wholeRoutes.length > 0) return;
 | 
				
			||||||
      this.wholeRoutes = ascending(this.constantRoutes.concat(routes)).filter(
 | 
					      this.wholeRoutes = filterTree(
 | 
				
			||||||
        v => v.meta.showLink
 | 
					        ascending(this.constantRoutes.concat(routes))
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const getButtonAuth = (arrRoutes: Array<string>) => {
 | 
					      const getButtonAuth = (arrRoutes: Array<string>) => {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user