mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
fit react router 2.x
This commit is contained in:
parent
9f6a211fde
commit
99fbd06ae5
@ -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">
|
||||
|
@ -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} />
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user