1. 文件布局
routes/index.js
import React from 'react';
import { Router, Route, hashHistory } from 'react-router';
import Home from '../views/Home';
import Detail from '../views/Detail';
const routes = (
<Router history={hashHistory}>
<Route path="/" component={Home}/>
<Route path="/detail/:id" component={Detail}/>
</Router>
);
export default routes;
app.js