--- order: 7 iframe: true title: Router 默认进出场 --- router 组合的进场与出场动画。 ````jsx const ReactRouter = require('react-router'); let { Router, Route, Link, hashHistory } = ReactRouter; import { QueueAnim, Menu } from 'antd'; function App(props) { const key = props.location.pathname; const keys = key.replace('/', '') ? [key.replace('/', '')] : ['home']; return (
首页 Page 1 Page 2 {React.cloneElement(props.children || , { key })}
); } function Home() { return (
  • ); } function Page1() { return (
  • ); } function Page2() { return (
  • ); } ReactDOM.render(( ), mountNode); ```` ````css #components-queue-anim-demo-router iframe { height: 260px; } #components-queue-anim-demo-router .demo-router-wrap { position: relative; width: 100%; margin: auto; height:200px; overflow: hidden; } #components-queue-anim-demo-router .queue-anim-leaving { position: absolute; width:100%; } ````