Skip to content

feat(button): add iconPos for button component #1867

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

fu050409
Copy link
Collaborator

允许设置 Button 图标位置

Resolved: #1866

What's Changed

  1. 为 Button 新增图标方位控制
  2. 已完成 Button 文档更新

@fu050409 fu050409 requested review from Julinear and GreatZPP May 30, 2024 04:36
Copy link
Member

@GreatZPP GreatZPP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议是我们不进行此种iconPos的接口提供,对于很大部分场景,我们提供icon方便嵌入,其他用户需自定义场景,在button内容区自我实现即可,保障很大部分场景用户可便捷配置,额外自定义场景可方便的形式自我实现即可。
组件封装此种api后,那么后续相关上的诉求用户都需要通过组件api的扩充才能实现,这是不需要的

@fu050409
Copy link
Collaborator Author

fu050409 commented May 31, 2024

这里我做一下解释:

我之所以提供此接口是在尝试使DevUI的过程中,我认为使用iconPos可以快速完成图标位置的切换,如果手动实现较为复杂且经测试可能出现使用默认图标和自定义右侧图标样式不完全一致(因为用户需要翻阅源码或进行元素审查才能知道我们默认图标的样式是如何实现的),直接加入此prop可以在使用component内置的图标接口的情况下完成。而且我看到DevUI中的Search元件同样包含了选择搜索图标方向的接口。

同时我参考了与我们类似的组件库PrimeVueHyperUI,均提供了类似iconPos的方案,而Element UI也提供了一个样式来实现右侧图标。

当然,如果确认此功能是不必要的,那么可以直接关闭此pr。

@fu050409 fu050409 requested a review from GreatZPP May 31, 2024 01:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ [Feature]: 允许设置 Button 图标位置
2 participants