mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
<view class="custom-class van-tabs van-tabs--{{ type }}">
|
|
<view 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 }}"
|
|
>
|
|
<view class="van-tabs__nav van-tabs__nav--{{ type }}" style="{{ color ? 'border-color: ' + color : '' }}">
|
|
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ lineStyle }}" />
|
|
<view
|
|
wx:for="{{ tabs }}"
|
|
wx:key="index"
|
|
data-index="{{ index }}"
|
|
class="van-tab {{ index === active ? 'van-tab--active' : '' }} {{ item.data.disabled ? 'van-tab--disabled' : '' }}"
|
|
style="{{ color && (index === active) !== (type === 'card') && !item.data.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }}"
|
|
bind:tap="onTap"
|
|
>
|
|
<view class="van-ellipsis">{{ item.data.title }}</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
<view class="van-tabs__content">
|
|
<slot />
|
|
</view>
|
|
</view>
|