-
-
Notifications
You must be signed in to change notification settings - Fork 51.4k
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
Carousel support show dot duration #52672
Conversation
|
👁 Visual Regression Report for PR #52672 Failed ❌
Important There are 8 diffs found in this PR: 🔄
|
WalkthroughThis pull request introduces a new feature to the Carousel component, allowing it to support the display of dot progress duration. This feature is controlled by the Changes
|
More templates
commit: |
Bundle ReportChanges will decrease total bundle size by 1.81kB (-0.05%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project status has failed because the head coverage (99.97%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## feature #52672 +/- ##
===========================================
- Coverage 100.00% 99.97% -0.03%
===========================================
Files 767 767
Lines 13823 13835 +12
Branches 3612 3621 +9
===========================================
+ Hits 13823 13832 +9
- Misses 0 3 +3 ☔ View full report in Codecov by Sentry. |
效果相当好! |
Signed-off-by: afc163 <afc163@gmail.com>
Signed-off-by: afc163 <afc163@gmail.com>
* feat: carousel support show dot duration * docs: add carousel dot duration demo * test: add carousel dot duration test * chore: add jest snap * docs: fix typos in test file * feat(api): redesign API for dot duration * test: update dot duration test items * docs: update md file for dot duration * chore: set default false to autoplay * Update components/carousel/index.zh-CN.md Signed-off-by: afc163 <afc163@gmail.com> * Update components/carousel/index.en-US.md Signed-off-by: afc163 <afc163@gmail.com> --------- Signed-off-by: afc163 <afc163@gmail.com> Co-authored-by: afc163 <afc163@gmail.com> (cherry picked from commit 16bedba)
position: 'absolute', | ||
top: 0, | ||
insetInlineStart: 0, | ||
width: 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.
这个不应该用 width
实现,看起来有点卡顿,应该用 transform: translate3d
做,性能会好一点
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.
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.
ok! 学习到了 😄
const mergedShowDuration = | ||
autoplay && (typeof autoplay === 'object' ? autoplay.dotDuration : false); | ||
const dotDurationStyle = mergedShowDuration | ||
? ({ [DotDuration]: `${autoplaySpeed / 1000}s` } as React.CSSProperties) |
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.
CSS 本身就支持 ms 做时间单位,没必要转成 s
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
close #46876
💡 Background and Solution
📝 Change Log