소스 검색

bugfix: fix var error

chenshuai2144 5 년 전
부모
커밋
ac1645442b
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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>;