@airpower/web 1.10.2 → 1.10.4
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.
- package/dist/main.js +13 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -19317,21 +19317,29 @@ 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
|
-
}
|
|
19324
19320
|
if (!this.router) {
|
|
19325
19321
|
FeedbackUtil.toastError("请先调用 createRouter 创建路由");
|
|
19326
19322
|
return;
|
|
19327
19323
|
}
|
|
19328
|
-
if (!item.name || !item.path
|
|
19324
|
+
if (!item.name || !item.path) {
|
|
19329
19325
|
FeedbackUtil.toastError("路由初始化失败,缺少参数");
|
|
19330
19326
|
return;
|
|
19331
19327
|
}
|
|
19332
19328
|
if (this.router.hasRoute(item.id.toString())) {
|
|
19333
19329
|
return;
|
|
19334
19330
|
}
|
|
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
|
+
}
|
|
19335
19343
|
this.router.addRoute(parentRouter, {
|
|
19336
19344
|
path: item.path,
|
|
19337
19345
|
name: item.id.toString(),
|