mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[improvement] Tab: optimize wxml (#860)
This commit is contained in:
parent
fbefab3972
commit
c88e8e02e2
@ -50,7 +50,7 @@
|
|||||||
.van-tab {
|
.van-tab {
|
||||||
color: @red;
|
color: @red;
|
||||||
border-right: 1px solid @red;
|
border-right: 1px solid @red;
|
||||||
line-height: @van-tabs-card-height - 2px;
|
line-height: @van-tabs-card-height;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
|
@ -13,16 +13,14 @@
|
|||||||
wx:for="{{ tabs }}"
|
wx:for="{{ tabs }}"
|
||||||
wx:key="index"
|
wx:key="index"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
class="van-tab {{ index === active ? 'van-tab--active' : '' }} {{ item.data.disabled ? 'van-tab--disabled' : '' }}"
|
class="van-ellipsis 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 : '' }}"
|
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"
|
bind:tap="onTap"
|
||||||
>
|
>
|
||||||
<view class="van-ellipsis">{{ item.data.title }}</view>
|
{{ item.data.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="van-tabs__content">
|
<slot />
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user