mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-30 15:16:42 +08:00
fix(projects): dic become link when childrens are all hide
fix the issue https://github.com/soybeanjs/soybean-admin/issues/325
This commit is contained in:
parent
3bdcbc71eb
commit
adbb164037
@ -194,7 +194,9 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
component: 'view.multi-menu_first_child',
|
component: 'view.multi-menu_first_child',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'multi-menu_first_child',
|
title: 'multi-menu_first_child',
|
||||||
i18nKey: 'route.multi-menu_first_child'
|
i18nKey: 'route.multi-menu_first_child',
|
||||||
|
hideInMenu: true,
|
||||||
|
// activeMenu: 'multi-menu_first'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -117,15 +117,18 @@ function transformElegantRouteToVueRoute(
|
|||||||
|
|
||||||
// add redirect to child
|
// add redirect to child
|
||||||
if (children?.length && !vueRoute.redirect) {
|
if (children?.length && !vueRoute.redirect) {
|
||||||
|
const allHide = children.every(childrenSingle => childrenSingle?.meta?.hideInMenu === true);
|
||||||
|
if (!allHide) {
|
||||||
vueRoute.redirect = {
|
vueRoute.redirect = {
|
||||||
name: children[0].name
|
name: children[0].name
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (children?.length) {
|
if (children?.length) {
|
||||||
const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views));
|
const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views));
|
||||||
|
|
||||||
if(isFirstLevelRoute(route)) {
|
if (isFirstLevelRoute(route)) {
|
||||||
vueRoute.children = childRoutes;
|
vueRoute.children = childRoutes;
|
||||||
} else {
|
} else {
|
||||||
vueRoutes.push(...childRoutes);
|
vueRoutes.push(...childRoutes);
|
||||||
|
@ -86,7 +86,8 @@ export function getGlobalMenusByAuthRoutes(routes: ElegantConstRoute[]) {
|
|||||||
const menu = getGlobalMenuByBaseRoute(route);
|
const menu = getGlobalMenuByBaseRoute(route);
|
||||||
|
|
||||||
if (route.children?.length) {
|
if (route.children?.length) {
|
||||||
menu.children = getGlobalMenusByAuthRoutes(route.children);
|
const allHide = route.children.every(childrenSingle => childrenSingle?.meta?.hideInMenu === true);
|
||||||
|
if (!allHide) menu.children = getGlobalMenusByAuthRoutes(route.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
menus.push(menu);
|
menus.push(menu);
|
||||||
|
Loading…
Reference in New Issue
Block a user