TabBar.wxml
1.2 KB
<block wx:if="{{scroll}}">
<scroll-view class=" scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}" id="to-{{index}}">
<text id="tab-{{index}}">
<text class="tab-item-text">{{item.text || item }}</text><text class="tab-item-count" wx:if="{{item.count}}"><text style="margin: 0 6rpx;">·</text>{{item.count}}</text>
</text>
</view>
</block>
<view class="active-doc" style="{{activeStyle}}" />
</scroll-view>
</block>
<block wx:else>
<view class="tab" style="grid-template-columns: repeat({{tabList.length}}, 1fr);font-size:{{tabList.length>5?'var(--fontSize24)':''}} ;">
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
<text id="tab-{{index}}"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count}}"><text style="margin: 0 6rpx;">·</text>{{item.count}}</text></text>
</view>
</block>
<view class="active-doc" style="{{activeStyle}}" />
</view>
</block>