Skip to content

Commit

Permalink
fix: 修复 Mix 布局下面包屑显示不全的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Aug 6, 2024
1 parent 050a171 commit 917cd43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getBreadcrumbList() {
const cloneRoutes = JSON.parse(JSON.stringify(routes)) as RouteLocationMatched[]
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) {
breadcrumbList.value = [home, ...arr]
}
Expand Down
3 changes: 2 additions & 1 deletion src/layout/LayoutMix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const appStore = useAppStore()
const routeStore = useRouteStore()
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[]>([])
Expand Down

0 comments on commit 917cd43

Please sign in to comment.