| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <view class="custom-class van-tabs van-tabs--{{ type }}">
- <view style="z-index: {{ zIndex }}; {{ wrapStyle }}" class="van-tabs__wrap {{ scrollable ? 'van-tabs__wrap--scrollable' : '' }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}">
- <scroll-view
- scroll-x="{{ scrollable }}"
- scroll-with-animation
- scroll-left="{{ scrollLeft }}"
- class="van-tabs__scroll--{{ type }}"
- style="{{ color ? 'border-color: ' + color : '' }}"
- >
- <view class="van-tabs__nav van-tabs__nav--{{ type }}">
- <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ lineStyle }}" />
- <view
- wx:for="{{ tabs }}"
- wx:key="index"
- data-index="{{ index }}"
- class="van-ellipsis van-tab {{ index === active ? 'van-tab--active' : '' }} {{ item.disabled ? 'van-tab--disabled' : '' }}"
- style="{{ color && index !== active && type === 'card' && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }} {{ scrollable ? ';flex-basis:' + (88 / swipeThreshold) + '%' : '' }}"
- bind:tap="onTap"
- >
- <view class="van-ellipsis van-tab__title">
- {{ item.title }}
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- <view
- class="van-tabs__content"
- bind:touchstart="onTouchStart"
- bind:touchmove="onTouchMove"
- bind:touchend="onTouchEnd"
- bind:touchcancel="onTouchEnd"
- >
- <view class="van-tabs__track" style="{{ trackStyle }}">
- <slot />
- </view>
- </view>
- </view>
|