mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
* add src dir && add build * add build watch && change dir name * bower ignore package.json
32 lines
1010 B
Plaintext
32 lines
1010 B
Plaintext
<template name="zan-tab">
|
|
<view class="zan-tab">
|
|
<block wx:if="{{tab.scroll}}">
|
|
<scroll-view
|
|
class="zan-tab__bd zan-tab__bd--scroll {{ fixed ? 'zan-tab__bd--fixed' : '' }}"
|
|
scroll-x="true"
|
|
style="height: {{ tab.height ? tab.height + 'px' : 'auto' }}"
|
|
>
|
|
<template is="zan-tab-list" data="{{ tab, componentId }}"></template>
|
|
</scroll-view>
|
|
</block>
|
|
<block wx:else>
|
|
<view class="zan-tab__bd {{fixed ? 'zan-tab__bd--fixed' : ''}}">
|
|
<template is="zan-tab-list" data="{{ tab, componentId }}"></template>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</template>
|
|
|
|
<template name="zan-tab-list">
|
|
<view
|
|
wx:for="{{tab.list}}"
|
|
wx:key="id"
|
|
class="zan-tab__item {{tab.selectedId == item.id ? 'zan-tab__item--selected' : ''}}"
|
|
data-component-id="{{componentId}}"
|
|
data-item-id="{{item.id}}"
|
|
bindtap="_handleZanTabChange"
|
|
>
|
|
<view class="zan-tab__title">{{item.title}}</view>
|
|
</view>
|
|
</template>
|