mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-28 16:57:08 +08:00
fix: 修复 Mix 布局下面包屑显示不全的问题
This commit is contained in:
@@ -36,7 +36,7 @@ function getBreadcrumbList() {
|
|||||||
const cloneRoutes = JSON.parse(JSON.stringify(routes)) as RouteLocationMatched[]
|
const cloneRoutes = JSON.parse(JSON.stringify(routes)) as RouteLocationMatched[]
|
||||||
const obj = findTree(cloneRoutes, (i) => i.path === route.path)
|
const obj = findTree(cloneRoutes, (i) => i.path === route.path)
|
||||||
// 获取当前节点的所有上级节点集合,包含当前节点
|
// 获取当前节点的所有上级节点集合,包含当前节点
|
||||||
const arr = obj.nodes.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
const arr = obj ? obj.nodes.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false) : []
|
||||||
if (home) {
|
if (home) {
|
||||||
breadcrumbList.value = [home, ...arr]
|
breadcrumbList.value = [home, ...arr]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ const appStore = useAppStore()
|
|||||||
const routeStore = useRouteStore()
|
const routeStore = useRouteStore()
|
||||||
const { isDesktop } = useDevice()
|
const { isDesktop } = useDevice()
|
||||||
// 过滤是菜单的路由
|
// 过滤是菜单的路由
|
||||||
const menuRoutes = filterTree(routeStore.routes, (i) => i.meta?.hidden === false)
|
const cloneRoutes = JSON.parse(JSON.stringify(routeStore.routes)) as RouteRecordRaw[]
|
||||||
|
const menuRoutes = filterTree(cloneRoutes, (i) => i.meta?.hidden === false)
|
||||||
|
|
||||||
// 顶部一级菜单
|
// 顶部一级菜单
|
||||||
const topMenus = ref<RouteRecordRaw[]>([])
|
const topMenus = ref<RouteRecordRaw[]>([])
|
||||||
|
|||||||
Reference in New Issue
Block a user