45 lines
1.6 KiB
XML
45 lines
1.6 KiB
XML
<view class="ant-tab-bar {{className || ''}}" style="{style || ''}">
|
|
<view class="ant-tab-bar-wrap">
|
|
<view
|
|
class="ant-tab-bar-item {{ index === mixin.value ? ('ant-tab-bar-item-active' + (activeClassName || '')) : '' }}"
|
|
style="{{index === mixin.value ? (activeStyle||'') : ''}}"
|
|
a:for="{{items}}"
|
|
onTap="onChange"
|
|
data-index="{{index}}"
|
|
>
|
|
<badge
|
|
a:if="{{item.badge}}"
|
|
type="{{item.badge.type}}"
|
|
text="{{item.badge.text}}"
|
|
number="{{item.badge.number}}"
|
|
stroke="{{item.badge.stroke}}"
|
|
iconType="{{item.badge.iconType}}"
|
|
bgColor="{{item.badge.bgColor}}"
|
|
position="{{item.badge.position || 'top-right'}}"
|
|
offsetX="{{item.badge.offsetX || '-9px'}}"
|
|
offsetY="{{item.badge.offsetY || '0px'}}"
|
|
>
|
|
<slot name="icon" active="{{mixin.value == index}}" item="{{item}}" index="{{index}}">
|
|
<image-icon
|
|
className="ant-tab-bar"
|
|
image="{{mixin.value === index? item.activeIcon : item.icon}}"
|
|
/>
|
|
</slot>
|
|
</badge>
|
|
<slot a:else name="icon" active="{{mixin.value == index}}" item="{{item}}" index="{{index}}">
|
|
<image-icon
|
|
className="ant-tab-bar"
|
|
image="{{mixin.value === index?item.activeIcon : item.icon}}"
|
|
/>
|
|
</slot>
|
|
<view class="ant-tab-bar-text-wrap">
|
|
<slot name="text" active="{{mixin.value === index}}" item="{{item}}" index="{{index}}">
|
|
<text class="ant-tab-bar-text">
|
|
{{item.text}}
|
|
</text>
|
|
</slot>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|