Commit d2afa15e authored by afc163's avatar afc163

Fix default activeTabKey, close #563

parent 34e69e55
...@@ -126,6 +126,13 @@ export default class PageHeader extends PureComponent { ...@@ -126,6 +126,13 @@ export default class PageHeader extends PureComponent {
tabDefaultValue = tabList.filter(item => item.default)[0] || tabList[0]; tabDefaultValue = tabList.filter(item => item.default)[0] || tabList[0];
} }
const activeKeyProps = {
defaultActiveKey: tabDefaultValue && tabDefaultValue.key,
};
if (activeTabKey !== undefined) {
activeKeyProps.activeKey = activeTabKey;
}
return ( return (
<div className={clsString}> <div className={clsString}>
{breadcrumb} {breadcrumb}
...@@ -147,8 +154,7 @@ export default class PageHeader extends PureComponent { ...@@ -147,8 +154,7 @@ export default class PageHeader extends PureComponent {
tabList.length && ( tabList.length && (
<Tabs <Tabs
className={styles.tabs} className={styles.tabs}
defaultActiveKey={(tabDefaultValue && tabDefaultValue.key)} {...activeKeyProps}
activeKey={activeTabKey}
onChange={this.onChange} onChange={this.onChange}
> >
{ {
......
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