Skip to content

Commit

Permalink
fix(plugin-layout): 修复面包屑的最后项的跳转以及颜色 (#11140)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzm0x219 committed May 24, 2023
1 parent 7617bc0 commit 5e39b2e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/plugins/src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,17 @@ const { formatMessage } = useIntl();
}
return defaultDom;
}}
itemRender={(route) => <Link to={route.path}>{route.breadcrumbName}</Link>}
itemRender={(route, _, routes) => {
const { breadcrumbName, title, path } = route;
const label = title || breadcrumbName
const last = routes[routes.length - 1]
if (last) {
if (last.path === path || last.linkPath === path) {
return <span>{label}</span>;
}
}
return <Link to={path}>{label}</Link>;
}}
disableContentMargin
fixSiderbar
fixedHeader
Expand Down

0 comments on commit 5e39b2e

Please sign in to comment.