zoukankan      html  css  js  c++  java
  • react 路由 404页面配置

            <Switch>
              <Redirect from="/" to="/light/login" exact></Redirect>
              <Route path="/light/login" component={Login}></Route>
              <Route path="/light/index" component={Index}></Route>
              <Route path="/404" component={NotFound}></Route>
              <Redirect from="*" to="/404" exact></Redirect>
            </Switch>

    二级路由需要同样的配置:

        listDom.push(<Redirect key="404" from="*" to="/404" exact></Redirect>)    
    
        <div className="m-list">
          <Header></Header>
          <div className="m-list-info">
            <Nav></Nav>
            <Suspense fallback={<Loading isLazyLoading={true}></Loading>}>
              <Switch>
                {listDom}
              </Switch>
            </Suspense>
          </div>
        </div>

  • 相关阅读:
    【原】戏说Java
    git分支branch合并到主分支master
    环境搭建
    zookeeper简单实战
    zookeeper介绍
    临时表与中间表
    避免活跃性
    sss
    sss
    sss
  • 原文地址:https://www.cnblogs.com/xutongbao/p/15264329.html
Copyright © 2011-2022 走看看