Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(Tab): support remaining badge component property#13431

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
YiMo1 wants to merge4 commits intoyouzan:main
base:main
Choose a base branch
Loading
fromYiMo1:feat/tab-rest-prop

Conversation

YiMo1
Copy link

修改Tab组件的Badge属性的类型,在原有的类型上新增剩余的BadgeProps类型(去除已存在的dot和showZero)确保不会对以往的版本有太大的破环性改变。

@codecov-commenter
Copy link

codecov-commenter commentedApr 10, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is87.50000% with1 line in your changes missing coverage. Please review.

Project coverage is 89.71%. Comparing base(ec5b45b) to head(7259d35).
Report is 111 commits behind head on main.

Files with missing linesPatch %Lines
packages/vant/src/tab/TabTitle.tsx87.50%0 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main   #13431      +/-   ##==========================================+ Coverage   89.60%   89.71%   +0.10%==========================================  Files         257      257                Lines        7013     7036      +23       Branches     1736     1746      +10     ==========================================+ Hits         6284     6312      +28+ Misses        384      380       -4+ Partials      345      344       -1

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

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@chenjiahanchenjiahan left a comment
edited
Loading

Choose a reason for hiding this comment

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

Can you add some test cases for this change? Thanks

@YiMo1
Copy link
Author

YiMo1 commentedApr 14, 2025
edited
Loading

Can you add some test cases for this change? Thanks

@chenjiahan 当然可以,不过我遇到一个错误,当badge为对象字面量时就会导致下面这个错误。如果badge为ref包裹的对象则没有这个问题。我目前正在解决这个,但进度不太理想,我可能要花一些时间。😞
最简单的办法就是不用对象的形式,就像和dot属性一样全都提取出来,但这样的话担心tab的属性会变得臃肿,你怎么认为?

<van-tabs><van-tab:badge="{}"/> // Error: Maximum recursive updates exceeded in component<van-tabs></van-tabs>
<script>constbadge=ref({});</script><template><van-tabs><van-tab:badge="badge"/> // No Error</van-tabs></template>

我在vue的练习场中复刻了这一行为:链接
我不确定这是否是Vue本身的问题,还是这种写法本就是不允许的。

@chenjiahan
Copy link
Member

看起来是循环触发渲染了,可能要加一些判断逻辑

@YiMo1YiMo1 marked this pull request as draftJune 3, 2025 02:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chenjiahanchenjiahanchenjiahan left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@YiMo1@codecov-commenter@chenjiahan

[8]ページ先頭

©2009-2025 Movatter.jp