如图,渲染两次,然后一闪,变为一个,不知道什么原因
react-router用的三版本
<Router history={hashHistory}>
<Route path="/" component={BasePage}>
<IndexRoute component={Login} />
<Route path="login" component={Login}/>
<Route path="register" component={Register}/>
<Route path="recover" component={Recover}/>
<Route path="code" component={VerifyCode}/>
<Route path="newpassword" component={NewPassword}/>
<Route path="notfound" component={NotFound}/>
<Route path="error500" component={Error500}/>
<Route path="maintenance" component={Maintenance}/>
</Route>
</Router>
sidebar:
<Link to="warningmanage" title="WaringManage">
<em className="icon-layers"></em>
<span data-localize="sidebar.nav.WIDGETS">警示管理</span>
</Link>
这个官方说是V3的一个bug,换V4的话成本太高,暂时不想换,所以有没有在V3的版本上好的解决方案呢,感激!!!
v3的这个bug确实存在,网上也有很多解决方案,但是应用起来不是很顺畅,应该是本人技术没有过关吧,现在采取bowerHistory的方法,后端nginx服务配置项中加入try_files属性即可。