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>

本文详细介绍如何在React项目中使用React Router进行路由配置,包括引入Router、Route和hashHistory,以及如何引入和使用加载页和场地资源首页组件。
5649

被折叠的 条评论
为什么被折叠?



