【发布时间】:2018-03-01 07:34:17
【问题描述】:
这是我运行良好的路线配置。
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route path="city">
<Route path=":city" component={City} />
</Route>
<Route path="country">
<Route path=":country" component={Country} />
</Route>
</Route>
它适用于网址 example.com/city/london 和 example.com/country/england
现在我想改变它,以便在用户输入时
example.com/london -> 城市,
example.com/england -> 国家
我现在该如何设置路线?
【问题讨论】:
-
添加了一个示例工作演示。请检查更新
标签: reactjs react-router react-redux react-router-v4