Commit 75c71052 authored by zjfcool's avatar zjfcool Committed by 言肆

fix:formatRelativePath

parent 2d62f674
......@@ -13,9 +13,6 @@ const formatRelativePath = (
): RouteRecordRaw[] => {
// 计算路由绝对路径
return routes.map(route => {
if (route.path.startsWith('/')) {
return route;
}
if (parent) {
route.path = `${parent.path || ''}/${route.path}`;
} else {
......@@ -24,7 +21,7 @@ const formatRelativePath = (
route.path = route.path.replace('//', '/');
// format children routes
if (route.children && route.children.length > 0) {
route.children = formatRelativePath(route.children, route);
route.children = formatRelativePath(route.children, breadcrumb, route);
}
breadcrumb[`${route.path}`] = route;
return route;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment