用的是react-router4,每一次手动输入url进行跳转都会自动添加一个#比如 我输入 localhost:8000/index => localhost:8000/index#/ 变成这样了路由代码是function RouterConfig({ history }) { return( <Router history={history}> <Switch> <Route exact path="" component={lsPage}/> <Route exact path="/index" component={layout} /> </Switch> </Router> )} export default RouterConfig;
1 回答
红颜莎娜
TA贡献1842条经验 获得超12个赞
您是不是使用的hashHistory路由。
使用hashHistory,浏览器的url就是这样的:localhost:8000/index#/
而使用browserHistory,浏览器的url是这样的:localhost:8000/index
希望我的回答能帮助到您^_^
添加回答
举报
0/150
提交
取消