提交 99a44e9b 编写于 作者: F fanzheng.fz 提交者: afc163

always concat paths wether there's a breadcrumbName or not

上级 4614f406
......@@ -52,14 +52,6 @@ const Breadcrumb = React.createClass({
if (routes && routes.length > 0) {
const paths = [];
crumbs = routes.map((route, i) => {
if (!route.breadcrumbName) {
return null;
}
const name = route.breadcrumbName.replace(/\:(.*)/g, (replacement, key) => {
return params[key] || replacement;
});
let link;
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
......@@ -68,6 +60,14 @@ const Breadcrumb = React.createClass({
paths.push(path);
}
if (!route.breadcrumbName) {
return null;
}
const name = route.breadcrumbName.replace(/\:(.*)/g, (replacement, key) => {
return params[key] || replacement;
});
let link;
if (i === routes.length - 1) {
link = <span>{name}</span>;
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册