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
:id?
使用 :id? 可选参数路由,在 url 输入 http://localhost:8000/m 回车,不会跳转到 m/demo/1 而是跳转到 /app/demo
url
http://localhost:8000/m
m/demo/1
/app/demo
{ path: 'demo/:id?', name: 'demo2', component: './Access', },
Please provide a minimal reproduction then upload to your GitHub. 请提供 最小重现,并上传到你的 GitHub 仓库
https://github.com/crazyair/antd5/tree/pathname
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
pathname
The text was updated successfully, but these errors were encountered:
:id? 可选参数不能这样写了?那现在要怎么写
Sorry, something went wrong.
现在 umi 4 没支持可选路由参数,可以写一个空路由代表没匹配的情况:
{ path: '/path', routes: [ { path: '', component: 'path', }, { path: ':id', component: 'path', }, ], }
主要是不想同一个 component 要写 2 个 route,想尽量精简
No branches or pull requests
What happens?
使用
:id?
可选参数路由,在url
输入http://localhost:8000/m
回车,不会跳转到m/demo/1
而是跳转到/app/demo
Mini Showcase Repository(REQUIRED)
https://github.com/crazyair/antd5/tree/pathname
How To Reproduce
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
pathname
分支http://localhost:8000/m
并回车Context
The text was updated successfully, but these errors were encountered: