feat(Tab): support remaining badge component property#13431
Draft
YiMo1 wants to merge 4 commits intoyouzan:mainfrom
Draft
feat(Tab): support remaining badge component property#13431YiMo1 wants to merge 4 commits intoyouzan:mainfrom
YiMo1 wants to merge 4 commits intoyouzan:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
chenjiahan
reviewed
Apr 13, 2025
Author
@chenjiahan 当然可以,不过我遇到一个错误,当badge为对象字面量时就会导致下面这个错误。如果badge为ref包裹的对象则没有这个问题。我目前正在解决这个,但进度不太理想,我可能要花一些时间。😞 <van-tabs>
<van-tab :badge="{}" /> // Error: Maximum recursive updates exceeded in component <van-tabs>
</van-tabs><script>
const badge = ref({});
</script>
<template>
<van-tabs>
<van-tab :badge="badge" /> // No Error
</van-tabs>
</template>我在vue的练习场中复刻了这一行为:链接 |
Member
|
看起来是循环触发渲染了,可能要加一些判断逻辑 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改Tab组件的Badge属性的类型,在原有的类型上新增剩余的BadgeProps类型(去除已存在的dot和showZero)确保不会对以往的版本有太大的破环性改变。