- 公司要求用react写活动页面,因为活动很多,累积了很多路由,这种有什么解决方案吗?代码如下:
// 引入页面入口
import React, { Component } from 'react';
import { Route } from "react-router-dom";
import {
advice,
stage,
settle,
storeDownload,
agreement,
payPage,
Excessive,
inpark,
inparkOneWash,
welfareIndex,
welfareArea,
oldDriver,
headlines,
YlPreheat,
YlActive,
MerchantOperation
} from './routerName';
export default class Main extends Component{
render(){
return(
<div>
<Route path="/advice" component={ advice } />
<Route path="/stage" component={ stage }/>
<Route path="/settle" component={ settle }/>
<Route path="/storeDownload" component={ storeDownload }/>
<Route path="/agreement" component={ agreement }/>
<Route path="/payPage" component={ payPage }/>
<Route path="/Excessive" component={ Excessive }/>
<Route path="/inpark" component={ inpark }/>
<Route path="/inparkOneWash" component={ inparkOneWash }/>
<Route path="/welfareIndex" component={ welfareIndex }/>
<Route path="/welfareArea" component={ welfareArea }/>
<Route path="/oldDriver" component={ oldDriver }/>
<Route path="/headlines" component={ headlines }/>
<Route path="/YlPreheat" component={ YlPreheat }/>
<Route path="/YlActive" component={ YlActive }/>
<Route path="/MerchantOperation" component={ MerchantOperation }/>
</div>
)
}
}