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