【发布时间】:2016-05-12 22:35:52
【问题描述】:
我正在使用 react-router 进行路由,并使用 hashHistory 选项,以便我可以从浏览器刷新页面或指定我现有路由之一的 url 并登陆正确的页面。 它工作正常,但我在 url 中看到这样的哈希: http://localhost/#/login?_k=ya6z6i
这是我的路由配置:
ReactDOM.render((
<Router history={hashHistory}>
<Route path='/' component={MasterPage}>
<IndexRoute component={LoginPage} />
<Route path='/search' component={SearchPage} />
<Route path='/login' component={LoginPage} />
<Route path='/payment' component={PaymentPage} />
</Route>
</Router>),
document.getElementById('app-container'));
【问题讨论】:
标签: reactjs react-router