import BasicRouter from './routes';
class RouterContainer extends React.Component {
constructor(props) {
super();
this.state = {
textHelp: props.text
}
}
render () {
return (
<div>
<BasicRouter />
</div>
);
}
}
export default RouterContainer;
const BasicRouter = () => (
<Router history={hashHistory}>
{/* 登陆 */}
<Route path='/' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/index').default);
},'User');
}}
/>
<Route path='/register' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/register').default);
},'Register');
}} />
<Route path='/login' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/login').default);
},'Login');
}} />
<Route path='/regExp' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/create-regular-expression').default);
},'CreateRegularExpression');
}} />
<Route path='/shopcart' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/shopcart').default);
},'Shopcart');
}} />
{/* 电信3期 - 大屏 */}
<Route path='/tel' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/telecom').default);
},'Telecommunication');
}} />
<Route path='/ct' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/telecom/components/contain-task').default);
},'ContainTask');
}} />
<Route path='/st' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/telecom/components/separate-task/fetch-promise-async').default);
},'SeparateTask');
}} />
{/* 新疆 - 智能感知运维大屏 */}
<Route path='/per' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/perception').default);
},'Perception');
}} />
{/* 新疆 - 运行态势智能大屏 */}
<Route path='/sit' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/situation').default);
},'Situation');
}} />
<Route path='/manage' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/manage-redux').default);
},'ManageRedux');
}} />
<Route path='/manageSystem' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../../slides/user/modules/ManageSystem').default);
},'ManageSystem');
}} />
{/* 其他重定向到 404 */}
<Route path='/404' getComponent={
(nextState,callback)=>{
require.ensure([],(require)=>{
callback(null,require('../404').default);
},'NotFound');
}} />
{/* 其他重定向到 404 */}
<Redirect from='*' to='/404'/>
</Router>
);
export default BasicRouter;
把hashHistory,换成browserHistory就行了。