fix: 🐛 补充 basePath 父级路径
Former-commit-id: cce921b52b3f93fb9be8d9619c788a5b1b585fe9
This commit is contained in:
@@ -54,6 +54,7 @@ function hasOneShowingChild(children = [], parent: any) {
|
||||
// 2:如果无子路由, 复制当前路由信息作为其子路由,满足只拥有一个子路由的条件,所以返回 true
|
||||
if (showingChildren.length === 0) {
|
||||
onlyOneChild.value = { ...parent, path: "", noShowingChildren: true };
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -71,6 +72,7 @@ function resolvePath(routePath: string) {
|
||||
if (isExternal(props.basePath)) {
|
||||
return props.basePath;
|
||||
}
|
||||
|
||||
// 完整路径 = 父级路径(/level/level_3) + 路由路径
|
||||
const fullPath = path.resolve(props.basePath, routePath); // 相对路径 → 绝对路径
|
||||
return fullPath;
|
||||
|
||||
Reference in New Issue
Block a user