<Layout>
<Switch>
<Route path='/' exact render={()=> (
<Redirect to='/home'/>
)}/>
<Route path='/home' component={Home} />
<Route path='/articles' component={Articles} />
</Switch>
</Layout>
通过render方法返回Redirect组件,Redirect 重定向到其他路由,即可实现默认路由。