fix(menu): fix externalLink not work

This commit is contained in:
vben
2020-12-07 23:56:57 +08:00
parent e921e7b98f
commit 7bae4c3752
5 changed files with 15 additions and 7 deletions

View File

@@ -89,12 +89,17 @@ export async function getFlatChildrenMenus(children: Menu[]) {
function basicFilter(routes: RouteRecordNormalized[]) {
return (menu: Menu) => {
const matchRoute = routes.find((route) => {
if (route.meta.externalLink) {
return true;
}
if (route.meta) {
if (route.meta.carryParam) {
return pathToRegexp(route.path).test(menu.path);
}
if (route.meta.ignoreAuth) return false;
if (route.meta.ignoreAuth) return true;
}
return route.path === menu.path;
});