Closed xiaoqufengdi closed 2 years ago
如有配置式的路由,routes为子路由,子路由访问不生效 function RouteWithSubRoutes(route) { return ( <Route path={route.path} render={props => ( // pass the sub-routes down to keep nesting <route.component {...props} routes={route.routes} /> )} /> ); } 具体参照 react router
function RouteWithSubRoutes(route) { return ( <Route path={route.path} render={props => ( // pass the sub-routes down to keep nesting <route.component {...props} routes={route.routes} /> )} /> ); }
同问
需要自行处理配置式路由规则,当前库只是提供 Route 组件,没办法关注到 json 配置的解析
如有配置式的路由,routes为子路由,子路由访问不生效
function RouteWithSubRoutes(route) { return ( <Route path={route.path} render={props => ( // pass the sub-routes down to keep nesting <route.component {...props} routes={route.routes} /> )} /> ); }
具体参照 react router