We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我按照你的思路来配置路由
import asyncComponent from '../AsyncComponent' import {renderRoutes} from 'react-router-config' const routes = [ { path: '/', component: asyncComponent(() => import('../views/Home')), routes: [ { path: '/categories', component: asyncComponent(() => import('../views/Categories')), }, { path: '/categories/:categoryId', component: asyncComponent(() => import('../views/Two')) } // { // path: '/two', // component: asyncComponent(() => import('../views/Two')) // } ] } ] const MBRoutes = renderRoutes(routes) export default MBRoutes
然后在页面中进行跳转
onEnter = (categoryId: string) => { this.props.history.push(`/categories/${categoryId}`) }
url变了,但是没有跳转,可能没有匹配到路由。我试了一下写成/two就可以,请问一下这个该怎么正确实现动态路由/categories/:categoryId呢?
The text was updated successfully, but these errors were encountered:
@penggelies07
import {renderRoutes} from 'react-router-config' const routes = [ { path: '/', component: asyncComponent(() => import('../views/Home')), }, { path: '/categories', component: asyncComponent(() => import('../views/Categories')), }, { path: '/categories/:categoryId', component: asyncComponent(() => import('../views/Two')) }, { path: '/two', component: asyncComponent(() => import('../views/Two')) } ] const MBRoutes = renderRoutes(routes) export default MBRoutes
你好 你可以把路由提出来,这样写试试吧
Sorry, something went wrong.
No branches or pull requests
我按照你的思路来配置路由
然后在页面中进行跳转
url变了,但是没有跳转,可能没有匹配到路由。我试了一下写成/two就可以,请问一下这个该怎么正确实现动态路由/categories/:categoryId呢?
The text was updated successfully, but these errors were encountered: