Skip to content

新建页面无法新增路由 No routes matched location "/xxx" #12118

Answered by fz6m
SilentFlute asked this question in Q&A
Discussion options

You must be logged in to vote

由于考虑到大部分用户最后路由表都比较多和复杂,所以现在 umi 4 默认创建出来的模板项目都默认采用配置式路由了,就是在 .umirc.ts 里手动配置 routes ,如果用了配置式路由,约定式就不好用了,所以你需要 /about 这个路由就需要去 routes 配置里新增这个路径才行。

如果你不需要配置式路由,就把配置文件里的 routes 删了即可。

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SilentFlute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants