提交 7176b4ac 编写于 作者: J jim

fix #1324 Step-Form breadcrumbs path problem

上级 99715b01
......@@ -26,6 +26,18 @@ export default class PageHeader extends PureComponent {
location: PropTypes.object,
breadcrumbNameMap: PropTypes.object,
};
state = {
breadcrumb: null,
};
componentDidMount() {
this.getBreadcrumbDom();
}
componentWillReceiveProps() {
this.getBreadcrumbDom();
}
onChange = key => {
if (this.props.onTabChange) {
this.props.onTabChange(key);
......@@ -39,6 +51,12 @@ export default class PageHeader extends PureComponent {
breadcrumbNameMap: this.props.breadcrumbNameMap || this.context.breadcrumbNameMap,
};
};
getBreadcrumbDom = () => {
const breadcrumb = this.conversionBreadcrumbList();
this.setState({
breadcrumb,
});
};
// Generated according to props
conversionFromProps = () => {
const { breadcrumbList, breadcrumbSeparator, linkElement = 'a' } = this.props;
......@@ -158,8 +176,8 @@ export default class PageHeader extends PureComponent {
tabDefaultActiveKey,
tabBarExtraContent,
} = this.props;
const clsString = classNames(styles.pageHeader, className);
const breadcrumb = this.conversionBreadcrumbList();
const activeKeyProps = {};
if (tabDefaultActiveKey !== undefined) {
activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
......@@ -170,7 +188,7 @@ export default class PageHeader extends PureComponent {
return (
<div className={clsString}>
{breadcrumb}
{this.state.breadcrumb}
<div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>}
<div className={styles.main}>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册