Commit a2d9a578 authored by yoyo837's avatar yoyo837 Committed by 偏右

find

parent 1f4b5bbf
...@@ -132,15 +132,10 @@ export default class BasicLayout extends React.PureComponent { ...@@ -132,15 +132,10 @@ export default class BasicLayout extends React.PureComponent {
const { routerData, location } = this.props; const { routerData, location } = this.props;
const { pathname } = location; const { pathname } = location;
let title = 'Ant Design Pro'; let title = 'Ant Design Pro';
let currRouterData = null;
// match params path // match params path
Object.keys(routerData).some(key => { const currRouterData = (Object.entries(routerData).find(([key]) =>
if (pathToRegexp(key).test(pathname)) { pathToRegexp(key).test(pathname)
currRouterData = routerData[key]; ) || [])[1];
return true;
}
return false;
});
if (currRouterData && currRouterData.name) { if (currRouterData && currRouterData.name) {
title = `${currRouterData.name} - Ant Design Pro`; title = `${currRouterData.name} - Ant Design Pro`;
} }
......
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