fix: change showMainRoute to canTo

This commit is contained in:
kailong321200875
2022-06-30 21:00:33 +08:00
parent 7fb38b9693
commit 5e292f8a2b
5 changed files with 20 additions and 20 deletions

View File

@@ -9,7 +9,7 @@ export const filterBreadcrumb = (
for (const route of routes) {
const meta = route?.meta as RouteMeta
if (meta.hidden && !meta.showMainRoute) {
if (meta.hidden && !meta.canTo) {
continue
}

View File

@@ -27,7 +27,7 @@ export const filterMenusPath = (
for (const v of routes) {
let data: Nullable<AppRouteRecordRaw> = null
const meta = (v.meta ?? {}) as RouteMeta
if (!meta.hidden || meta.showMainRoute) {
if (!meta.hidden || meta.canTo) {
const allParentPaht = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path)
const fullPath = isUrl(v.path) ? v.path : allParentPaht.join('/')