Browse Source

fix(layout): Not rendering the current Link repeatedly

close #7800
chenshuai2144 5 years atrás
parent
commit
d2abf996b6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/layouts/BasicLayout.tsx

+ 1 - 1
src/layouts/BasicLayout.tsx

@@ -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>;