浏览代码

Merge pull request #263 from renchao8697/fix/routerHelper

fix: 使用动态路由时,多级路由只有一个子路且父路由未使用alwaysShow时,子路由未添加至路由中
Archer 2 年之前
父节点
当前提交
df34a5f59a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/utils/routerHelper.ts

+ 1 - 1
src/utils/routerHelper.ts

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