react router简单使用

1.引入路由

import {Router, Route, hashHistory} from 'react-router';

2.引入组件

//引入加载页
import Loading from './loading';
//场地资源首页
import Index from './Component/Index.js';

3.使用

<Router history={hashHistory}>
    <Route path="/" component={Loading}/>
    <Route path="/mainPage" component={Index }/>
</Router>
发布了39 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/YYYYYun/article/details/95083359