Fix BreadCrumb IndexRoute support, close #1375 & #571

This commit is contained in:
afc163 2016-04-11 11:16:31 +08:00
parent e3834829e4
commit 76f14b4bd2

View File

@ -52,6 +52,7 @@ const Breadcrumb = React.createClass({
if (routes && routes.length > 0) {
const paths = [];
crumbs = routes.map((route, i) => {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);