Skip to content
New issue

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

👑 [需求] plugin-layout childrenRender 传入 route 路由信息? #744

Closed
yunsii opened this issue Nov 16, 2021 · 2 comments
Closed

Comments

@yunsii
Copy link
Contributor

yunsii commented Nov 16, 2021

🥰 需求描述

当前 childrenRender 入参只有 dom,当 childrenRender 需要使用路由相关信息时好像没办法直接拿到?
比如我此前基于 Pro V4 实现的页面标签页功能,需要使用 route 路由信息,通过修改生成的代码传入 route 是可以的。

🧐 解决方案

{
  // 1. 直接添加
  childrenRender?: (dom: JSX.Element, route: Route) => React.ReactNode,

  // 2. 考虑扩展性
  childrenRender?: (dom: JSX.Element, data: { route: Route} ) => React.ReactNode,
}
@yunsii yunsii changed the title 👑 [需求] ProLayout childrenRender 传入 route 路由信息? 👑 [需求] plugin-layout childrenRender 传入 route 路由信息? Nov 16, 2021
@yunsii
Copy link
Contributor Author

yunsii commented Nov 23, 2021

已发布 plugin-layout 0.17.4 -> 0.18.0

@yunsii yunsii closed this as completed Nov 23, 2021
@yunsii
Copy link
Contributor Author

yunsii commented Nov 25, 2021

另,如果使用 @umijs/preset-react 版本不得低于 1.8.28,详见此更新

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

No branches or pull requests

1 participant