Browse Source

Fix breadcrumbName replace (#1797)

pull/2007/head
afc163 9 years ago
parent
commit
4b05250a6b
  1. 4
      components/breadcrumb/Breadcrumb.jsx

4
components/breadcrumb/Breadcrumb.jsx

@ -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…
Cancel
Save