mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 15:53:43 +08:00 
			
		
		
		
	optimize(projects): supports custom menu icon sizes (#534)
This commit is contained in:
		@@ -123,7 +123,7 @@ function getGlobalMenuByBaseRoute(route: RouteLocationNormalizedLoaded | Elegant
 | 
			
		||||
  const { SvgIconVNode } = useSvgIcon();
 | 
			
		||||
 | 
			
		||||
  const { name, path } = route;
 | 
			
		||||
  const { title, i18nKey, icon = import.meta.env.VITE_MENU_ICON, localIcon } = route.meta ?? {};
 | 
			
		||||
  const { title, i18nKey, icon = import.meta.env.VITE_MENU_ICON, localIcon, iconFontSize } = route.meta ?? {};
 | 
			
		||||
 | 
			
		||||
  const label = i18nKey ? $t(i18nKey) : title!;
 | 
			
		||||
 | 
			
		||||
@@ -133,7 +133,7 @@ function getGlobalMenuByBaseRoute(route: RouteLocationNormalizedLoaded | Elegant
 | 
			
		||||
    i18nKey,
 | 
			
		||||
    routeKey: name as RouteKey,
 | 
			
		||||
    routePath: path as RouteMap[RouteKey],
 | 
			
		||||
    icon: SvgIconVNode({ icon, localIcon, fontSize: 20 })
 | 
			
		||||
    icon: SvgIconVNode({ icon, localIcon, fontSize: iconFontSize || 20 })
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return menu;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								src/typings/router.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/typings/router.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -42,6 +42,8 @@ declare module 'vue-router' {
 | 
			
		||||
     * In "src/assets/svg-icon", if it is set, the icon will be ignored
 | 
			
		||||
     */
 | 
			
		||||
    localIcon?: string;
 | 
			
		||||
    /** Icon size. width and height are the same. */
 | 
			
		||||
    iconFontSize?: number;
 | 
			
		||||
    /** Router order */
 | 
			
		||||
    order?: number | null;
 | 
			
		||||
    /** The outer link of the route */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user