Skip to content

Commit

Permalink
Merge pull request #244 from shayumo/fix/breadcrumb
Browse files Browse the repository at this point in the history
fix: 面包屑:1.修复使用动态路由的时候,无法显示的bug
  • Loading branch information
kailong321200875 committed Mar 13, 2023
2 parents ffb7282 + 8790c8c commit 84981ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Breadcrumb/src/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export default defineComponent({
})
const getBreadcrumb = () => {
const currentPath = currentRoute.value.path
const currentPath = currentRoute.value.matched.slice(-1)[0].path
levelList.value = filter<AppRouteRecordRaw>(unref(menuRouters), (node: AppRouteRecordRaw) => {
return node.path === currentPath
})
Expand All @@ -47,7 +46,7 @@ export default defineComponent({
const renderBreadcrumb = () => {
const breadcrumbList = treeToList<AppRouteRecordRaw[]>(unref(levelList))
return breadcrumbList.map((v) => {
const disabled = v.redirect === 'noredirect'
const disabled = !v.redirect || v.redirect === 'noredirect'
const meta = v.meta as RouteMeta
return (
<ElBreadcrumbItem to={{ path: disabled ? '' : v.path }} key={v.name}>
Expand Down

0 comments on commit 84981ec

Please sign in to comment.