Browse Source

bugfix: fix var error

pull/7859/head
chenshuai2144 5 years ago
parent
commit
ac1645442b
  1. 6
      src/layouts/BasicLayout.tsx

6
src/layouts/BasicLayout.tsx

@ -133,7 +133,11 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => history.push('/')}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path || pathname === menuItemProps.path) {
if (
menuItemProps.isUrl ||
!menuItemProps.path ||
location.pathname === menuItemProps.path
) {
return defaultDom;
}
return <Link to={menuItemProps.path}>{defaultDom}</Link>;

Loading…
Cancel
Save