TabBar.wxml
1.22 KB
<block wx:if="{{ scroll }}">
<scroll-view class="scroll" scroll-x enable-flex scroll-with-animation scroll-into-view="{{ to }}">
<block wx:for="{{ tabItems }}" 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.label}}</text><text wx:if="{{ item.count >= 0 }}" style="font-size: var(--fontSize20);">({{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({{ tabItems.length}}, 1fr);font-size:{{tabItems.length>5?'var(--fontSize24)':'' }} ;"
>
<block wx:for="{{ tabItems }}" wx:key="index">
<!-- style="color:{{tabIndex==index?'#347BFF':''}};" -->
<view class="tab-item {{ tabIndex==index?'active':'' }}" bindtap="change" data-index="{{ index }}">
<text id="tab-{{ index }}"><text class="tab-item-text">{{item.label}}</text><text wx:if="{{ item.count >= 0 }}" style="font-size: var(--fontSize20);">({{item.count}})</text></text>
</view>
</block>
<view class="active-doc" style="{{ activeStyle }}" />
</view>
</block>