mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
Fix breadcrumbName replace (#1797)
This commit is contained in:
parent
74ef0b7951
commit
4b05250a6b
@ -5,8 +5,10 @@ const defaultNameRender = (breadcrumbName, route, params) => {
|
||||
if (!breadcrumbName) {
|
||||
return null;
|
||||
}
|
||||
const paramsKeys = Object.keys(params).join('|');
|
||||
const name = breadcrumbName.replace(
|
||||
/:(.*)/g, (replacement, key) => params[key] || replacement
|
||||
new RegExp(`:(${paramsKeys})`, 'g'),
|
||||
(replacement, key) => params[key] || replacement
|
||||
);
|
||||
return <span>{name}</span>;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user