Skip to content

Commit

Permalink
fix: tabbar 某些情况下 setTabBarBadge 出现重复的 badge
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloudhdx committed Sep 22, 2022
1 parent 0ad5383 commit 89a9a66
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/platforms/h5/components/app/tabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@
v-else-if="!item.isMidButton"
:src="_getRealPath(getIconPath(item,index))"
>
<div
v-if="item.redDot"
:class="{'uni-tabbar__badge':!!item.badge}"
class="uni-tabbar__reddot"
>
{{ item.badge }}
</div>
</div>
<div
v-if="item.text"
Expand All @@ -74,13 +67,13 @@
class="uni-tabbar__label"
>
{{ item.text }}
<div
v-if="item.redDot&&!item.iconPath"
:class="{'uni-tabbar__badge':!!item.badge}"
class="uni-tabbar__reddot"
>
{{ item.badge }}
</div>
</div>
<div
v-if="item.redDot"
:class="{'uni-tabbar__badge':!!item.badge}"
class="uni-tabbar__reddot"
>
{{ item.badge }}
</div>
</div>
</div>
Expand Down Expand Up @@ -199,14 +192,14 @@
uni-tabbar .uni-tabbar__reddot {
position: absolute;
top: 0;
top: 2px;
right: 0;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: #f43530;
color: #ffffff;
transform: translate(40%, -20%);
transform: translate(40%, 0%);
}
uni-tabbar .uni-tabbar__badge {
Expand Down

0 comments on commit 89a9a66

Please sign in to comment.