ZhongAnTech / zarm

基于 React 的移动端 UI 组件库
https://zarm.design
MIT License
1.71k stars 225 forks source link

Fix carousel width hight #1169

Closed zyf-xcode closed 4 months ago

zyf-xcode commented 4 months ago

修复Carousel组件宽高不精确问题。原offsetWidth offsetHeight计算不准确,在展示时内容会有像素偏差,下一个轮播内容会漏出一点。

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zarm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2024 10:37am
github-actions[bot] commented 4 months ago

🎊 PR Preview has been successfully built and deployed to https://zarm-preview-pr-1169.surge.sh

JeromeLin commented 4 months ago

image demo报错了

zyf-xcode commented 4 months ago

修改getOffsetSize方法,添加返回兜底数据,无报错

JeromeLin commented 4 months ago

有问题哈,拖到最后一页就白屏了

zyf-xcode commented 4 months ago

简化方法使用,删除冗余的getOffsetSize

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.40%. Comparing base (1926b57) to head (83ae848).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1169 +/- ## ========================================== + Coverage 83.59% 90.40% +6.80% ========================================== Files 17 220 +203 Lines 128 5127 +4999 Branches 21 1218 +1197 ========================================== + Hits 107 4635 +4528 - Misses 21 482 +461 - Partials 0 10 +10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.