简体   繁体   English

反应哈希路由和子路由

[英]React hash routing and sub routing

I have currently route structure for example #/home #/dashboard我目前有路由结构,例如#/home #/dashboard

but how can I implement sub-route or child route such as但是如何实现子路由或子路由,例如

#/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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM