-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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:
|
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.
Can you add some test cases for this change? Thanks
@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的练习场中复刻了这一行为:链接 |
看起来是循环触发渲染了,可能要加一些判断逻辑 |
修改Tab组件的Badge属性的类型,在原有的类型上新增剩余的BadgeProps类型(去除已存在的dot和showZero)确保不会对以往的版本有太大的破环性改变。