From 1fac84b222237161ca7f94815ee73425e280ee4c Mon Sep 17 00:00:00 2001 From: haianweifeng <1531297152@qq.com> Date: Thu, 30 May 2019 17:28:19 +0800 Subject: [PATCH] fix Breadcrumb.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getPath() 参数赋默认值 --- components/breadcrumb/Breadcrumb.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index 2bdbdb13b4..0db011c8f5 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -71,8 +71,8 @@ export default class Breadcrumb extends React.Component { ); } - getPath = (path, params) => { - path = (path || '').replace(/^\//, ''); + getPath = (path = '', params = {}) => { + path = path.replace(/^\//, ''); Object.keys(params).forEach(key => { path = path.replace(`:${key}`, params[key]); });