chore(routeHelper): [Fixes #3217] remove undefined property

This commit is contained in:
invalid w 2023-11-03 11:53:33 +08:00
parent beed7f2e11
commit 4de756aa2d

View File

@ -78,11 +78,12 @@ export function transformObjToRoute<T = AppRouteModule>(routeList: AppRouteModul
} else {
route.children = [cloneDeep(route)];
route.component = LAYOUT;
//某些情况下如果name如果没有值 多个一级路由菜单会导致页面404
if (!route.name || !route.menuName) {
warn('找不到菜单对应的name或menuName, 请检查数据!');
//某些情况下如果name如果没有值 多个一级路由菜单会导致页面404
if (!route.name) {
warn('找不到菜单对应的name, 请检查数据!' + JSON.stringify(route));
}
route.name = `${route.name || route.menuName}Parent`;
route.name = `${route.name}Parent`;
route.path = '';
const meta = route.meta || {};
meta.single = true;