Kaynağa Gözat

Delete hardcode, decouple location

陈帅 7 yıl önce
ebeveyn
işleme
1e0a8c5d8c

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1275 - 0
log.csv


+ 5 - 5
src/components/PageHeader/index.js

@@ -28,12 +28,12 @@ export default class PageHeader extends PureComponent {
   }
   }
 
 
   componentDidUpdate(preProps) {
   componentDidUpdate(preProps) {
-    const {
-      tabActiveKey,
-      location: { pathname },
-    } = this.props;
+    const { location } = this.props;
+    if (!location || !preProps.location) {
+      return;
+    }
     const prePathname = preProps.location.pathname;
     const prePathname = preProps.location.pathname;
-    if (preProps.tabActiveKey !== tabActiveKey || prePathname !== pathname) {
+    if (prePathname !== location.pathname) {
       this.getBreadcrumbDom();
       this.getBreadcrumbDom();
     }
     }
   }
   }

+ 1 - 1
src/components/PageHeader/index.less

@@ -22,7 +22,7 @@
   }
   }
 
 
   .tabs {
   .tabs {
-    margin: 0 0 -17px -8px;
+    margin: 0 0 0 -8px;
 
 
     :global {
     :global {
       .ant-tabs-bar {
       .ant-tabs-bar {