|
|
|
@ -1,5 +1,4 @@ |
|
|
|
import React, { PureComponent, createElement } from 'react'; |
|
|
|
import PropTypes from 'prop-types'; |
|
|
|
import pathToRegexp from 'path-to-regexp'; |
|
|
|
import { Breadcrumb, Tabs } from 'antd'; |
|
|
|
import classNames from 'classnames'; |
|
|
|
@ -20,12 +19,6 @@ export function getBreadcrumb(breadcrumbNameMap, url) { |
|
|
|
} |
|
|
|
|
|
|
|
export default class PageHeader extends PureComponent { |
|
|
|
static contextTypes = { |
|
|
|
routes: PropTypes.array, |
|
|
|
params: PropTypes.object, |
|
|
|
location: PropTypes.object, |
|
|
|
breadcrumbNameMap: PropTypes.object, |
|
|
|
}; |
|
|
|
onChange = key => { |
|
|
|
if (this.props.onTabChange) { |
|
|
|
this.props.onTabChange(key); |
|
|
|
@ -33,10 +26,10 @@ export default class PageHeader extends PureComponent { |
|
|
|
}; |
|
|
|
getBreadcrumbProps = () => { |
|
|
|
return { |
|
|
|
routes: this.props.routes || this.context.routes, |
|
|
|
params: this.props.params || this.context.params, |
|
|
|
routerLocation: this.props.location || this.context.location, |
|
|
|
breadcrumbNameMap: this.props.breadcrumbNameMap || this.context.breadcrumbNameMap, |
|
|
|
routes: this.props.routes, |
|
|
|
params: this.props.params, |
|
|
|
routerLocation: this.props.location, |
|
|
|
breadcrumbNameMap: this.props.breadcrumbNameMap, |
|
|
|
}; |
|
|
|
}; |
|
|
|
// Generated according to props
|
|
|
|
|