# Router 默认进出场 - order: 7 router 组合的进场与出场动画。 --- ````jsx var ReactRouter = require('react-router'); var Router = ReactRouter.Router; var Route = ReactRouter.Route; var Link = ReactRouter.Link; var EnterAnimation = antd.EnterAnimation; var Menu = antd.Menu; var App = React.createClass({ getInitialState: function () { return {}; }, clickPage() { this.setState({ enter: {delay: 0.3}, leave: {delay: 0} }); }, render() { var key = this.props.location.pathname; return (
首页 Page 1 Page 2 {React.cloneElement(this.props.children ||

Home

这是首页
, {key: key})}
); } }); var Page1 = React.createClass({ render() { return (

Page 1

A link to page 2 should be active依次进场

A link to page 2 should be active依次进场

A link to page 2 should be active依次进场

A link to page 2 should be active依次进场

A link to page 2 should be active改变样式

); } }); var Page2 = React.createClass({ render() { return (

Page 2

a link to page 1 我是页面2.

a link to page 1 我是页面2.

a link to page 1 我是页面2.

a link to page 1 我是页面2.

); } }); React.render(( ), document.getElementById('components-enter-animation-demo-router')); ````