mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 07:43:42 +08:00 
			
		
		
		
	feat(route): 路由meta新增activeMenu属性
This commit is contained in:
		@@ -21,7 +21,7 @@ const theme = useThemeStore();
 | 
			
		||||
const { routerPush } = useRouterPush();
 | 
			
		||||
 | 
			
		||||
const menus = computed(() => routeStore.menus as GlobalMenuOption[]);
 | 
			
		||||
const activeKey = computed(() => route.name as string);
 | 
			
		||||
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
 | 
			
		||||
 | 
			
		||||
function handleUpdateMenu(_key: string, item: MenuOption) {
 | 
			
		||||
  const menuItem = item as GlobalMenuOption;
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ const { title } = useAppInfo();
 | 
			
		||||
 | 
			
		||||
const showDrawer = computed(() => (props.visible && props.menus.length) || app.mixSiderFixed);
 | 
			
		||||
 | 
			
		||||
const activeKey = computed(() => route.name as string);
 | 
			
		||||
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
 | 
			
		||||
const expandedKeys = ref<string[]>([]);
 | 
			
		||||
 | 
			
		||||
function handleUpdateMenu(_key: string, item: MenuOption) {
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ const theme = useThemeStore();
 | 
			
		||||
const routeStore = useRouteStore();
 | 
			
		||||
const { routerPush } = useRouterPush();
 | 
			
		||||
 | 
			
		||||
const activeKey = computed(() => route.name as string);
 | 
			
		||||
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
 | 
			
		||||
const expandedKeys = ref<string[]>([]);
 | 
			
		||||
 | 
			
		||||
function handleUpdateMenu(_key: string, item: MenuOption) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								src/typings/route.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/typings/route.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -93,6 +93,8 @@ declare namespace AuthRoute {
 | 
			
		||||
    order?: number;
 | 
			
		||||
    /** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */
 | 
			
		||||
    multi?: boolean;
 | 
			
		||||
    /** 当前路由需要选中的菜单项(用于跳转至不在左侧菜单显示的路由且需要高亮某个菜单的情况) */
 | 
			
		||||
    activeMenu?: RouteKey;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  /** 单个路由的类型结构(动态路由模式:后端返回此类型结构的路由) */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user