mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
remove react-router dependency from breadcrumb
This commit is contained in:
parent
46aee94b06
commit
925f811b45
@ -35,7 +35,7 @@ var App = React.createClass({
|
||||
<Link to="/">首页</Link>
|
||||
<Link to="/apps">应用列表</Link>
|
||||
</div>
|
||||
<Breadcrumb />
|
||||
<Breadcrumb Router={Router} />
|
||||
<RouteHandler />
|
||||
</div>);
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import Router from 'react-router';
|
||||
|
||||
let Link = Router.Link;
|
||||
|
||||
let prefixCls = 'ant-breadcrumb';
|
||||
|
||||
@ -24,7 +21,8 @@ let Breadcrumb = React.createClass({
|
||||
},
|
||||
render() {
|
||||
var crumbs, routes, params;
|
||||
if (this.context.router) {
|
||||
if (this.context.router && this.props.Router) {
|
||||
var Link = this.props.Router.Link;
|
||||
routes = this.context.router.getCurrentRoutes();
|
||||
params = this.context.router.getCurrentParams();
|
||||
crumbs = routes.map(function(route, i) {
|
||||
|
Loading…
Reference in New Issue
Block a user