Commit ec93edcc authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

Increase the judgment of pathname

parent 8f0262b2
...@@ -35,8 +35,12 @@ export default class PageHeader extends PureComponent { ...@@ -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();
} }
} }
......
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';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment