@airpower/web 1.10.4 → 1.10.5

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 +6 -12
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -19317,6 +19317,10 @@ 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
+ return;
19323
+ }
19320
19324
  if (!this.router) {
19321
19325
  FeedbackUtil.toastError("请先调用 createRouter 创建路由");
19322
19326
  return;
@@ -19328,24 +19332,14 @@ class RouterUtil {
19328
19332
  if (this.router.hasRoute(item.id.toString())) {
19329
19333
  return;
19330
19334
  }
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
19335
  this.router.addRoute(parentRouter, {
19344
19336
  path: item.path,
19345
19337
  name: item.id.toString(),
19346
19338
  meta: {
19347
19339
  name: item.name
19348
19340
  },
19341
+ redirect: item.children && item.children.length > 0 ? item.children[0].path : void 0,
19342
+ children: [],
19349
19343
  component: this.components[`${this.componentsDirectory}${item.component || item.path}.vue`]
19350
19344
  });
19351
19345
  });
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.5",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",