[英]React hash routing and sub routing
我目前有路由结构,例如#/home
#/dashboard
但是如何实现子路由或子路由,例如
#/home/dashboard
<HashRouter>
<main className="h-100">
<Switch>
<Route exact path='/home' component={Login} />
<Route path='/dashboard' component={Dashboard} />
</Switch>
</main>
</HashRouter>
例如,您可以简单地将路线更改为子路线
<Route exact path='/home/subroute' component={Login} />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.