提交 925f811b 编写于 作者: A afc163

remove react-router dependency from breadcrumb

上级 46aee94b
......@@ -35,7 +35,7 @@ var App = React.createClass({
<Link to="/">首页</Link>
<Link to="/apps">应用列表</Link>
</div>
<Breadcrumb />
<Breadcrumb Router={Router} />
<RouteHandler />
</div>);
}
......
'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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册