我已经开发了一个页面,反应,其途径是如何添加斜线反应路由器路径
http://example.come/page1
当URL被加载,我需要在URL这样
年底追加一个斜杠http://example.come/page1/
我的路线是这样的
Router history={browserHistory}>
<Route path='/' component={Home} />
<Route path='/page1' component={Page1} />
</Router>
我试图改变路径,直接到“/第1页/”而不是“/第1页”,但是这将不会加载http://example.com/page1
,这将打开只http://example.com/page1/
我想这两个路径来加载第1页组件
路径中的用户正则表达式 –
正则表达式如何改变路径?我将匹配路径并加载页面 – John
使用钩子(onEnter和onChange)? https://github.com/ReactTraining/react-router/issues/820#issuecomment-256814655 –