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

feat(swipe): add RTL mode #13123

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat(swipe): add RTL mode #13123

wants to merge 9 commits into from

Conversation

ys152452
Copy link

新增了swipe在direction属性为rtl时的布局和交互
更好的支持阿拉伯语、波斯语等RTL语言场景

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 93.67%. Comparing base (1f24cbc) to head (7bd4dfd).
Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
packages/vant/src/swipe/Swipe.tsx 65.51% 8 Missing and 2 partials ⚠️
packages/vant/src/utils/dom.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13123      +/-   ##
==========================================
- Coverage   93.81%   93.67%   -0.14%     
==========================================
  Files         257      257              
  Lines        6999     7018      +19     
  Branches     1730     1742      +12     
==========================================
+ Hits         6566     6574       +8     
- Misses        377      386       +9     
- Partials       56       58       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

这个 PR 看起来会极大地影响 Swipe 组件的性能,因为涉及到大量的 isRtl() 调用,里面需要调用 getComputedStyle,会产生性能开销。

社区里 Swipe 组件一般都是怎么适配 RTL 的呢?感觉需要先做下调研

@ys152452
Copy link
Author

这个 PR 看起来会极大地影响 Swipe 组件的性能,因为涉及到大量的 isRtl() 调用,里面需要调用 getComputedStyle,会产生性能开销。

社区里 Swipe 组件一般都是怎么适配 RTL 的呢?感觉需要先做下调研

对这里进行了优化,只在initialize中进行一次调用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants