Tab.wxml 944 Bytes
<block wx:if="{{openScroll}}">
  <scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
    <block wx:for="{{tab}}" wx:key="index">
      <view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" data-item="{{item}}" id="to-{{index}}" >
        <view class="text" >{{item.text||item}}</view>
        <!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
        <view class="line"></view>
      </view>
    </block>
  </scroll-view>
</block>
<block wx:else>
  <view class="tab-box flex">
    <block wx:for="{{tab}}" wx:key="index">
      <view class="tab {{index==count||count==item.code?'active':''}}" bindtap="click" data-count="{{index}}" data-item="{{item}}">
        <view class="text text-center">{{item.text||item}}</view>
        <view class="line"></view>
      </view>
    </block>
  </view>
</block>