mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
Add breadcrumbName
This commit is contained in:
parent
71f4d3f95f
commit
53ce7a25c1
@ -44,9 +44,9 @@ var Home = React.createClass({
|
||||
|
||||
React.render((
|
||||
<Router history={history}>
|
||||
<Route name="首页" path="/" component={Home} ignoreScrollBehavior>
|
||||
<Route name="应用列表" path="apps" component={Apps}>
|
||||
<Route name="应用:id" path=":id" />
|
||||
<Route name="home" breadcrumbName="首页" path="/" component={Home} ignoreScrollBehavior>
|
||||
<Route name="apps" breadcrumbName="应用列表" path="apps" component={Apps}>
|
||||
<Route name="app" breadcrumbName="应用:id" path=":id" />
|
||||
</Route>
|
||||
</Route>
|
||||
</Router>
|
||||
|
@ -25,7 +25,7 @@ let Breadcrumb = React.createClass({
|
||||
routes = this.context.router.state.branch;
|
||||
params = this.context.router.state.params;
|
||||
crumbs = routes.map(function(route, i) {
|
||||
var name = route.name.replace(/\:(.*)/g, function(replacement, key) {
|
||||
var name = route.breadcrumbName.replace(/\:(.*)/g, function(replacement, key) {
|
||||
return params[key] || replacement;
|
||||
});
|
||||
var link;
|
||||
|
Loading…
Reference in New Issue
Block a user