簡體   English   中英

反應哈希路由和子路由

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM