-
Notifications
You must be signed in to change notification settings - Fork 552
Expand file tree
/
Copy pathtabbar.wxml
More file actions
14 lines (14 loc) · 980 Bytes
/
tabbar.wxml
File metadata and controls
14 lines (14 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<view class="weui-tabbar {{extClass}}">
<!-- 选中的时候往 weui-tabbar__item 加 class:weui-bar__item_on -->
<view data-index='{{index}}' bindtap="tabChange" wx:for="{{list}}" wx:key="index" class="weui-tabbar__item {{index === current ? 'weui-bar__item_on' : ''}}">
<view style="position: relative;display:inline-block;">
<view wx:if="{{item.slotIcon !=undefined ||item.selectSlotIcon != undefined}}" class="weui-tabbar__icon">
<slot wx:if="{{current !== index}}" name="{{item.slotIcon}}"></slot>
<slot wx:if="{{current === index}}" name="{{item.selectSlotIcon}}"></slot>
</view>
<image wx:else src="{{current === index ? item.selectedIconPath : item.iconPath}}" class="weui-tabbar__icon"></image>
<mp-badge wx:if="{{item.badge || item.dot}}" content="{{item.badge}}" style="position: absolute;top:-2px;left:calc(100% - 3px)"></mp-badge>
</view>
<view class="weui-tabbar__label">{{item.text}}</view>
</view>
</view>