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

[FR]: 支持CustomWrapper #3177

Open
hcg1023 opened this issue Aug 22, 2024 · 2 comments
Open

[FR]: 支持CustomWrapper #3177

hcg1023 opened this issue Aug 22, 2024 · 2 comments
Labels
Feature Request 新功能请求

Comments

@hcg1023
Copy link

hcg1023 commented Aug 22, 2024

NutUI 包名

@nutui/nutui-taro

这个功能解决了什么问题?

对于嵌套层级过深的组件,Taro提供了CustomWrapper这个组件来处理,避免baseLevel过高引起模板过大,但是nutui中使用了Taro.createSelectorQuery()的组件,如果在CustomWrapper内,将会引起报错,或者无法使用

你期望的组件设计是怎样的?

nutui可以提供一个nut-custom-wrapper,同时将组件的ctx向下传递,内部组件获取到customwrapper,则通过Taro.createSelectorQuery()获取元素时,采用了Taro.createSelectorQuery().in(customWrapperCtx)的方式获取

@hcg1023 hcg1023 added the Feature Request 新功能请求 label Aug 22, 2024
@hcg1023
Copy link
Author

hcg1023 commented Aug 22, 2024

或者是提供一对provide和inject的hook,可能相对而言会更合适,在内部需要用到createSelectorQuery()的位置就去取inject

@hcg1023
Copy link
Author

hcg1023 commented Aug 22, 2024

例如:menu、ellipsis等组件均会出错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request 新功能请求
Projects
None yet
Development

No branches or pull requests

1 participant