mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
fix Breadcrumb.tsx
getPath() 参数赋默认值
This commit is contained in:
parent
3122f3b86b
commit
1fac84b222
@ -71,8 +71,8 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
);
|
||||
}
|
||||
|
||||
getPath = (path, params) => {
|
||||
path = (path || '').replace(/^\//, '');
|
||||
getPath = (path = '', params = {}) => {
|
||||
path = path.replace(/^\//, '');
|
||||
Object.keys(params).forEach(key => {
|
||||
path = path.replace(`:${key}`, params[key]);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user