From c88e8e02e2bca32eaabca083bf1293e49b5ee85f Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 6 Nov 2018 16:02:23 +0800 Subject: [PATCH] [improvement] Tab: optimize wxml (#860) --- packages/tabs/index.less | 2 +- packages/tabs/index.wxml | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/tabs/index.less b/packages/tabs/index.less index 5a2d3364..7c6299c8 100644 --- a/packages/tabs/index.less +++ b/packages/tabs/index.less @@ -50,7 +50,7 @@ .van-tab { color: @red; border-right: 1px solid @red; - line-height: @van-tabs-card-height - 2px; + line-height: @van-tabs-card-height; &:last-child { border-right: none; diff --git a/packages/tabs/index.wxml b/packages/tabs/index.wxml index 2213dd58..35d57ece 100644 --- a/packages/tabs/index.wxml +++ b/packages/tabs/index.wxml @@ -13,16 +13,14 @@ wx:for="{{ tabs }}" wx:key="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 : '' }}" bind:tap="onTap" > - {{ item.data.title }} + {{ item.data.title }} - - - +