Skip to content

Commit

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

0 comments on commit fe96b39

Please sign in to comment.