From 63fcc3d97950d3c0dd14ec4ee2f1f88028b31067 Mon Sep 17 00:00:00 2001 From: jim Date: Mon, 14 May 2018 11:09:55 +0800 Subject: [PATCH] Ugly fix #1409 --- .gitignore | 1 + src/components/PageHeader/index.js | 8 +++++--- src/routes/Forms/StepForm/index.js | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fd9bf875..4770ad5a 100755 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ yarn.lock package-lock.json *bak jsconfig.json +.vscode/settings.json diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index 993bd57e..3080ed04 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -34,10 +34,12 @@ export default class PageHeader extends PureComponent { componentDidMount() { this.getBreadcrumbDom(); } - componentWillReceiveProps() { - this.getBreadcrumbDom(); - } + componentDidUpdate(preProps) { + if (preProps.tabActiveKey !== this.props.tabActiveKey) { + this.getBreadcrumbDom(); + } + } onChange = key => { if (this.props.onTabChange) { this.props.onTabChange(key); diff --git a/src/routes/Forms/StepForm/index.js b/src/routes/Forms/StepForm/index.js index 822cb504..3ab2374b 100644 --- a/src/routes/Forms/StepForm/index.js +++ b/src/routes/Forms/StepForm/index.js @@ -25,10 +25,11 @@ export default class StepForm extends PureComponent { } } render() { - const { match, routerData } = this.props; + const { match, routerData, location } = this.props; return ( -- GitLab