glTab.wxml 409 Bytes
<view class="tab" style="grid-template-columns:repeat({{tabList.length}},1fr)">
  <block wx:for="{{tabList}}" wx:key="index">
    <view class="tab-item" style="color:{{tabIndex==index?activeColor:''}};" bindtap="change" 
      data-index="{{index}}">
      <text class="tab-item-text" id="tab-{{index}}">{{item}}</text>
    </view>
  </block>
  <view class="active-doc" style="{{activeStyle}}"></view>
</view>