@airpower/web 1.10.4 → 1.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +5 -12
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -19317,6 +19317,9 @@ class RouterUtil {
19317
19317
  */
19318
19318
  static addRouterAsync(menuList, parentRouter) {
19319
19319
  menuList.forEach((item) => {
19320
+ if (item.children && item.children.length > 0) {
19321
+ this.addRouterAsync(item.children, parentRouter);
19322
+ }
19320
19323
  if (!this.router) {
19321
19324
  FeedbackUtil.toastError("请先调用 createRouter 创建路由");
19322
19325
  return;
@@ -19328,24 +19331,14 @@ class RouterUtil {
19328
19331
  if (this.router.hasRoute(item.id.toString())) {
19329
19332
  return;
19330
19333
  }
19331
- if (item.children && item.children.length > 0) {
19332
- this.router.addRoute(parentRouter, {
19333
- path: item.path,
19334
- name: item.id.toString(),
19335
- meta: {
19336
- name: item.name
19337
- },
19338
- redirect: item.children[0].path
19339
- });
19340
- this.addRouterAsync(item.children, parentRouter);
19341
- return;
19342
- }
19343
19334
  this.router.addRoute(parentRouter, {
19344
19335
  path: item.path,
19345
19336
  name: item.id.toString(),
19346
19337
  meta: {
19347
19338
  name: item.name
19348
19339
  },
19340
+ redirect: item.children && item.children.length > 0 ? item.children[0].path : void 0,
19341
+ children: [],
19349
19342
  component: this.components[`${this.componentsDirectory}${item.component || item.path}.vue`]
19350
19343
  });
19351
19344
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/web",
3
3
  "type": "module",
4
- "version": "1.10.4",
4
+ "version": "1.10.6",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",