Merge pull request #263 from renchao8697/fix/routerHelper

fix: 使用动态路由时,多级路由只有一个子路且父路由未使用alwaysShow时,子路由未添加至路由中
This commit is contained in:
Archer 2023-04-13 10:01:17 +08:00 committed by GitHub
commit df34a5f59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ export const generateRoutesFn1 = (
if (isUrl(item) && (onlyOneChild === item || route.path === item)) { if (isUrl(item) && (onlyOneChild === item || route.path === item)) {
data = Object.assign({}, route) data = Object.assign({}, route)
} else { } else {
const routePath = pathResolve(basePath, onlyOneChild || route.path) const routePath = onlyOneChild ?? pathResolve(basePath, route.path)
if (routePath === item || meta.followRoute === item) { if (routePath === item || meta.followRoute === item) {
data = Object.assign({}, route) data = Object.assign({}, route)
} }