|
|
|
@ -31,10 +31,20 @@ The link of Breadcrumb item targets `#` by default, you can use `itemRender` to
|
|
|
|
|
```jsx
|
|
|
|
|
import { Link } from 'react-router';
|
|
|
|
|
|
|
|
|
|
const routes = [{
|
|
|
|
|
path: 'index',
|
|
|
|
|
breadcrumbName: 'home'
|
|
|
|
|
}, {
|
|
|
|
|
path: 'first',
|
|
|
|
|
breadcrumbName: 'first'
|
|
|
|
|
}, {
|
|
|
|
|
path: 'second',
|
|
|
|
|
breadcrumbName: 'second'
|
|
|
|
|
}];
|
|
|
|
|
function itemRender(route, params, routes, paths) {
|
|
|
|
|
const last = routes.indexOf(route) === routes.length - 1;
|
|
|
|
|
return last ? <span>{route.breadcrumbName}</span> : <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return <Breadcrumb itemRender={itemRender} />;
|
|
|
|
|
return <Breadcrumb itemRender={itemRender} routes={routes} />;
|
|
|
|
|
```
|
|
|
|
|