Bläddra i källkod

Delete hardcode, decouple location

陈帅 7 år sedan
förälder
incheckning
1e0a8c5d8c
3 ändrade filer med 1281 tillägg och 6 borttagningar
  1. 1275 0
      log.csv
  2. 5 5
      src/components/PageHeader/index.js
  3. 1 1
      src/components/PageHeader/index.less

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1275 - 0
log.csv


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

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

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

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