-
Notifications
You must be signed in to change notification settings - Fork 285
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
✨ [Feature]: 组件增加HOC,实现支持在design Config中全局配置默认props #2940
Comments
Title: ✨ [Feature]: The component adds HOC, and implements the implementation of the global configuration of default props in design Config |
@hashiqi12138 这是一个很好的思路👍,对于现有组件的改造是不是就只需要给组件包裹一层 DesignConfigPropsHOC 函数,对于用户而言只需要像之前一样在 designConfig 中配置 props 就行了。如果可以的话可以提交一个PR,以一个组件为例,看下整体效果如何,效果好的话可以逐步推广到其他组件🤝 |
@hashiqi12138 This is a good idea 👍. For the transformation of existing components, do you only need to wrap the components with a layer of DesignConfigPropsHOC function, and for users, you only need to configure props in designConfig like before. If possible, you can submit a PR. Take a component as an example to see how the overall effect is. If the effect is good, you can gradually promote it to other components🤝 |
是的,我这周或者下周找个时间整理提交一下 |
Yes, I'll find some time to organize and submit this week or next week |
已经提交了 #3084 |
What problem does this feature solve
1、做主题开发的过程中,部分交互需要调整默认配置来实现
2、现有版本中已经通过designConfig开放部分配置选项,但目前实现方式为在组件中硬编码来适配,未做适配的属性就无法支持配置
3、如果能够配置所有的 props 选项,主题定制会更加灵活
What does the proposed API look like
1、增加 hoc 组件
2、将组件用 HOC 包裹
3、在对应 designConfig 中配置默认props,如base-select中配置默认不显示全部选项
4、实现 base-select默认不展示全部选项
What is your project name
无
The text was updated successfully, but these errors were encountered: