Browse Source

Increase the judgment of pathname

pull/1991/head
陈帅 8 years ago
parent
commit
ec93edcc60
  1. 8
      src/components/PageHeader/index.js
  2. 2
      src/pages/layouts/PageHeaderLayout.js

8
src/components/PageHeader/index.js

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

2
src/pages/layouts/PageHeaderLayout.js

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi/locale';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import PageHeader from '../../components/PageHeader'; import PageHeader from 'components/PageHeader';
import GridContent from './GridContent'; import GridContent from './GridContent';
import styles from './PageHeaderLayout.less'; import styles from './PageHeaderLayout.less';
import MenuContext from './MenuContext'; import MenuContext from './MenuContext';

Loading…
Cancel
Save