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
feat: Tabs support indicatorLength #44406
Conversation
Run & review this pull request in StackBlitz Codeflow. |
size-limit report 📦
|
@@ -54,6 +54,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | |||
| centered | 标签居中展示 | boolean | false | 4.4.0 | | |||
| defaultActiveKey | 初始化选中面板的 key,如果没有设置 activeKey | string | `第一个面板` | | | |||
| hideAdd | 是否隐藏加号图标,在 `type="editable-card"` 时有效 | boolean | false | | | |||
| indicatorLength | 自定义指示条长度,默认与 tab 等宽 | number \| (origin: number) => number | - | 5.9.0 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这居然是个属性,为啥不用 token 来搞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果需求是比文字短 32px,怎么设置?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为指示条的长度是自动匹配 tab 宽度的,不是纯样式。
如果需求是比文字短 32px,怎么设置?
indicatorLength={(origin: number) => origin - 32}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 建议 ConfigProvider 支持配置 Tabs 的
indicatorLength
,因为一般都是全局设置。 - 如果支持 ConfigProvider,还需要同步到 Card tabList
Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: rc-tabs@12.9.0 |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #44406 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 670 673 +3
Lines 11349 11386 +37
Branches 3067 3071 +4
=========================================
+ Hits 11349 11386 +37
☔ View full report in Codecov by Sentry. |
Signed-off-by: MadCcc <1075746765@qq.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #44311
💡 Background and solution
📝 Changelog
indicatorLength
to customize length of indicator.indicatorLength
属性,用于自定义指示条的长度☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 873f687
This pull request adds a new prop
indicatorLength
to theTabs
component, which allows users to customize the length of the indicator line. It also updates therc-tabs
dependency and the documentation in both English and Chinese.🔍 Walkthrough
🤖 Generated by Copilot at 873f687
indicatorLength
to theTabs
component to customize the length of the indicator line (link, link)rc-tabs
to 12.11.0 to support the new prop (link)package.json
file withprettier
(link)