You should not use and in the same route; will be ignored


  import Home from './programme/containers/home.jsx'
<Switch>
    <Route exact path="/login" component={Login}/>
    <Route path="/home" component={Home}>
       <Route path="/model" component={Model}/>
        <Route path="/result" component={Result}/>
    </Route>
    <Redirect from="/" to="/home" />
</Switch>

調整為

import Home from './programme/containers/home.jsx'
<Switch>
    <Route exact path="/login" component={Login}/>
    <Home>
         <Route path="/model" component={Model}/>
         <Route path="/result" component={Result}/>
    </Home>
    <Redirect from="/" to="/home" />
</Switch>

 

沒有足夠的理論知識,沒有多余的解釋,暫做項目問題記錄


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM