10分钟搞定react-router
1.路由的安装:
$ npm install -S react-router |
2.引入路由文件
import {Router, Route, browserHistory} from 'react-router'; |
3.配置路由器
平级路由(做跳转用)
const router = ( |
嵌套路由(做嵌套)
const router = ( |
应用:
class App extends React.Component { |