Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

patchRoutes 触发时机及返回的 routes 数据结构 #892

Open
sushi-su opened this issue Jun 14, 2022 · 7 comments
Open

patchRoutes 触发时机及返回的 routes 数据结构 #892

sushi-su opened this issue Jun 14, 2022 · 7 comments

Comments

@sushi-su
Copy link

版本:rc22
问题:patchRoutes 先于 render 执行,导致无法实现动态初始化路由。并且与 umi3 不同的是 patchRoutes 返回的 routes 是扁平结构,这点在新文档上未描述。求问在 umi4 应该如何实现动态初始化路由?

@xiaohuoni
Copy link
Member

xiaohuoni commented Jun 16, 2022

关于“动态路由”的讨论也好久了,是不是要直接给个定性。

只能支持“动态菜单”,不能支持“动态路由”?
“动态菜单”的最佳实践是什么?

@umijs/maintainer (只是好奇这个@会有用吗?)

@stormslowly
Copy link
Member

有用 闻风而来 ~

1 similar comment
@yuaanlin
Copy link
Member

有用 闻风而来 ~

@xierenyuan
Copy link
Member

感觉确实需要一个最佳实践

@xiaohuoni
Copy link
Member

爸爸没来啊 @sorrycc cc

有用 闻风而来 ~

@chenshuai2144
Copy link
Contributor

动态路由几乎没有什么意义,我建议去掉这个api,只让node去访问

@xierenyuan
Copy link
Member

xierenyuan commented Jun 20, 2022

动态路由几乎没有什么意义,我建议去掉这个api,只让node去访问

有一定的场景需要, 比如使用应用ID 去加载低代码路由, 在比如我们有类似语雀的文档平台, 业务项目通过接口拉取维护的文档路由, 在通过 文档提供的组件渲染。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants