-
Beta Was this translation helpful? Give feedback.
Answered by
fz6m
Mar 15, 2024
Replies: 2 comments
-
@fz6m 请求帮助 |
Beta Was this translation helpful? Give feedback.
0 replies
-
如果有 如果有 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ByYogi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果有
redirect
,umi 就自动把这个路由的组件给变成用于重定向的组件了,所以没法有routes
子路由。如果有
component
,那这个component
就展示在这个层级了,如果还想同时有routes
(子路由),就需要在component
组件里用<Outlet />
去展示子路由(来自于 umi 4 使用的 react router v6 的设定),如果不需要子路由就没必要配置routes
,如果需要嵌套子路由,就自行添加<Outlet />
到父路由,或者你不在父路由添加component
这个字段也可以。