Skip to content

Commit

Permalink
fix: 修复菜单为目录类型时路由报错
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Dec 15, 2021
1 parent e3a5893 commit 7dcec87
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/router/generator-router.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Result } from 'ant-design-vue';
import { RouteRecordRaw } from 'vue-router';
import { isUrl } from '@/utils/is';
import { constantRouterComponents } from '@/router/asyncModules';
Expand Down Expand Up @@ -54,6 +55,14 @@ export function filterAsyncRoute(
route.component = RouterTransition;
route.children = children;
route.redirect = { name: children[0].name };
} else {
route.component = (
<Result
status="500"
title={name}
sub-title="目录类型菜单不是真实页面,请为当前目录添加页面级子菜单或更改当前菜单类型."
/>
);
}
return route;
} else if (item.type === 1) {
Expand Down

0 comments on commit 7dcec87

Please sign in to comment.