Skip to content

Commit f8220c5

Browse files
authored
修复mp-tabbar中,未设置badge值却依旧显示红点的问题
先阶段中,再使用mp-tabbar组件时,即使在list中未设置badge,界面上依旧会显示红点。 正确逻辑应为,有数值时显示badge,无数值时不显示红点。
1 parent efaf057 commit f8220c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tabbar/tabbar.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view data-index='{{index}}' bindtap="tabChange" wx:for="{{list}}" class="weui-tabbar__item {{index === current ? 'weui-bar__item_on' : ''}}">
44
<view style="position: relative;display:inline-block;">
55
<image src="{{current === index ? item.selectedIconPath : item.iconPath}}" class="weui-tabbar__icon"></image>
6-
<mp-badge content="{{item.badge}}" style="position: absolute;top:-2px;left:calc(100% - 3px)"></mp-badge>
6+
<mp-badge wx:if="{{item.badge}}" content="{{item.badge}}" style="position: absolute;top:-2px;left:calc(100% - 3px)"></mp-badge>
77
</view>
88
<view class="weui-tabbar__label">{{item.text}}</view>
99
</view>

0 commit comments

Comments
 (0)