update code style

This commit is contained in:
afc163 2016-06-11 16:20:19 +08:00
parent 203b1ef388
commit 3c3811a227

View File

@ -8,11 +8,10 @@ title: 路由
````jsx
const ReactRouter = require('react-router');
let { Router, Route, Link, hashHistory } = ReactRouter;
const { Router, Route, Link, hashHistory } = ReactRouter;
import { Breadcrumb } from 'antd';
function Apps() {
return (
const Apps = () => (
<ul className="app-list">
<li>
<Link to="/apps/1">应用1</Link><Link to="/apps/1/detail">详情</Link>
@ -21,18 +20,17 @@ function Apps() {
<Link to="/apps/2">应用2</Link><Link to="/apps/2/detail">详情</Link>
</li>
</ul>
);
}
);
function Home(props) {
return (
const Home = (props) => (
<div>
<div className="demo-nav">
<Link to="/">首页</Link>
<Link to="/apps">应用列表</Link>
</div>
{props.children || 'Home'}
<div style={{
<div
style={{
marginBottom: 15,
marginTop: 15,
paddingBottom: 15,
@ -43,8 +41,7 @@ function Home(props) {
</div>
<Breadcrumb {...props} />
</div>
);
}
);
ReactDOM.render(
<Router history={hashHistory}>