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

✨ [Feature]: API 风格规范化 #1896

Open
1 task
CoderSerio opened this issue Jun 18, 2024 · 0 comments
Open
1 task

✨ [Feature]: API 风格规范化 #1896

CoderSerio opened this issue Jun 18, 2024 · 0 comments
Labels
enhancement Feature enhancement refactoring Refactor code

Comments

@CoderSerio
Copy link

What problem does this feature solve

现状

目前的 API 风格存在一些规范问题,或许需要进一步讨论,在下一个大版本前完成风格统一。

问题案例

目前感受到的最明显的问题是,同一组件中,API 名称不对称。
比如 Popover 组件 mouse-entry-delaymouse-leave-delay 的含义并不是恰好相反的,容易产生误解:

image

还有 Menu 等组件中,提供了 API width 却没有 height,这有些不符合习惯性的认知。

image

此外,感觉需要讨论下,对于宽高等样式进行控制的 API 是否有单独存在的必要,毕竟把它们放到 css 中进行修改也能达到一样的效果,所以要不要考虑仅暴露 classNamestyle 等属性 API 让用户自定义?

建议

综上所述,这里可能要做一些破坏性变更,不过这都是有价值的。
可以考虑在下一个大版本前,持续统计不合理或容易产生歧义的 API 命名,讨论是否需要对其进行修改。

What does the proposed API look like

(这个问题感觉先要进行讨论)

任务列表(收集中)

  • TODO
@fu050409 fu050409 added enhancement Feature enhancement refactoring Refactor code labels Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature enhancement refactoring Refactor code
Projects
None yet
Development

No branches or pull requests

2 participants