现在想把articesList
设置为默认路由,点击AppSider
里的文章标签去articlesList
路由,点击ArticlesList
里的文章进入articleDetail
路由
App.js
<Layout className="app-container">
<AppSider />
<AppContent />
</Layout>
AppContent
class AppContent extends React.Component {
render() {
return (
<Content className="app-content bg-fff">
<Switch>
<Route path="/articleDetail" component={ArticleDetail} />
<Route path='/articlesList/:tag' component={ArticlesList} />
</Switch>
</Content>
)
}
}
exact配合Redirect就可以了