Tab.wxml 1.07 KB
<wxs src="./Tab.wxs" module="filterUtils" />
<block wx:if="{{openScroll}}">
	<scroll-view
	 class="tab-box {{align}} {{outClassName}}"
	 scroll-x
	 enable-flex
	 scroll-with-animation
	 scroll-into-view="{{to}}"
	 enhanced="{{true}}"
	 show-scrollbar="{{false}}"
	>
		<block wx:for="{{tab}}" wx:key="index">
			<view
			 class="tab {{index==count?'active':''}}"
			 bindtap="click"
			 data-count="{{index}}"
			 id="to-{{index}}"
			>
				<view class="text">{{item}}</view>
				<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
				<view class="line" />
			</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?'active':''}}"
			 style="width:{{itemWidth}}"
			 bindtap="click"
			 data-count="{{index}}"
			>
				<view class="text text-center">
					{{item}}
				</view>
				<view class="line" style="lineStyle" />
				<view wx:if="{{filterUtils.hasRedpoint(redpoint,item)}}" class="redpoint" />
			</view>
		</block>
	</view>
</block>