Commit 50f96651c261cd8656f9475c455ffdc0ed261236
1 parent
b100d41d
feat: 更换为let const
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-ui-admin/src/store/modules/permission.js
| @@ -62,7 +62,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { | @@ -62,7 +62,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { | ||
| 62 | route.name = toCamelCase(route.path, true) | 62 | route.name = toCamelCase(route.path, true) |
| 63 | // 处理三级及以上菜单路由缓存问题,将path名字赋值给name | 63 | // 处理三级及以上菜单路由缓存问题,将path名字赋值给name |
| 64 | if (route.path.indexOf("/") !== -1) { | 64 | if (route.path.indexOf("/") !== -1) { |
| 65 | - var pathArr = route.path.split("/") | 65 | + const pathArr = route.path.split("/"); |
| 66 | route.name = toCamelCase(pathArr[pathArr.length - 1], true) | 66 | route.name = toCamelCase(pathArr[pathArr.length - 1], true) |
| 67 | } | 67 | } |
| 68 | route.hidden = !route.visible | 68 | route.hidden = !route.visible |
| @@ -91,7 +91,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { | @@ -91,7 +91,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { | ||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | function filterChildren(childrenMap, lastRouter = false) { | 93 | function filterChildren(childrenMap, lastRouter = false) { |
| 94 | - var children = [] | 94 | + let children = []; |
| 95 | childrenMap.forEach((el, index) => { | 95 | childrenMap.forEach((el, index) => { |
| 96 | if (el.children && el.children.length) { | 96 | if (el.children && el.children.length) { |
| 97 | if (!el.component && !lastRouter) { | 97 | if (!el.component && !lastRouter) { |