Explorar o código

bugfix: fix var error

chenshuai2144 %!s(int64=5) %!d(string=hai) anos
pai
achega
ac1645442b
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/layouts/BasicLayout.tsx

+ 5 - 1
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>;