提交 d2abf996 编写于 作者: C chenshuai2144

fix(layout): Not rendering the current Link repeatedly

close #7800
上级 996f20e5
......@@ -133,7 +133,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => history.push('/')}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path) {
if (menuItemProps.isUrl || !menuItemProps.path || pathname === menuItemProps.path) {
return defaultDom;
}
return <Link to={menuItemProps.path}>{defaultDom}</Link>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册