fit react router 2.x

This commit is contained in:
afc163 2016-02-17 16:42:26 +08:00
parent 9f6a211fde
commit 99fbd06ae5
3 changed files with 6 additions and 6 deletions

View File

@ -2,13 +2,13 @@
- order: 2
`react-router@1.x` 进行结合使用。
`react-router@2.x` 进行结合使用。
---
````jsx
const ReactRouter = require('react-router');
let { Router, Route, Link } = ReactRouter;
let { Router, Route, Link, hashHistory } = ReactRouter;
import { Breadcrumb } from 'antd';
const Apps = React.createClass({
@ -50,7 +50,7 @@ const Home = React.createClass({
});
ReactDOM.render(
<Router>
<Router history={hashHistory}>
<Route name="home" breadcrumbName="首页" path="/" component={Home}>
<Route name="apps" breadcrumbName="应用列表" path="apps" component={Apps}>
<Route name="app" breadcrumbName="应用:id" path=":id">

View File

@ -8,7 +8,7 @@ router 组合的进场与出场动画。
````jsx
const ReactRouter = require('react-router');
let { Router, Route, Link } = ReactRouter;
let { Router, Route, Link, hashHistory } = ReactRouter;
import { QueueAnim, Menu } from 'antd';
const App = React.createClass({
@ -121,7 +121,7 @@ const Page2 = React.createClass({
});
ReactDOM.render((
<Router>
<Router history={hashHistory}>
<Route path="/" component={App} ignoreScrollBehavior>
<Route path="page1" component={Page1} />
<Route path="page2" component={Page2} />

View File

@ -111,7 +111,7 @@
"react-addons-test-utils": "0.14.x",
"react-copy-to-clipboard": "^4.0.1",
"react-dom": "0.14.x",
"react-router": "~1.0.3",
"react-router": "^2.0.0",
"react-stateless-wrapper": "~1.0.2",
"reqwest": "~2.0.5",
"semver": "^5.1.0",