[improvement] Tab: update active style (#940)

This commit is contained in:
neverland 2018-11-23 21:06:40 +08:00 committed by GitHub
parent 7ad9223ace
commit e30bd6552a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -9,7 +9,7 @@
@green: #4b0;
@gray: #c9c9c9;
@gray-light: #e5e5e5;
@gray-darker: #666;
@gray-darker: #7d7e80;
@gray-dark: #999;
/* default colors */

View File

@ -71,7 +71,7 @@
height: 2px;
position: absolute;
background-color: @red;
border-radius: 2px 0 2px 0;
border-radius: 2px;
}
&--line {
@ -98,7 +98,7 @@
padding: 0 5px;
font-size: 14px;
position: relative;
color: @text-color;
color: @gray-darker;
line-height: @van-tabs-line-height;
text-align: center;
box-sizing: border-box;
@ -110,7 +110,8 @@
}
&--active {
color: @red;
font-weight: 500;
color: @text-color;
}
&--disabled {

View File

@ -14,7 +14,7 @@
wx:key="index"
data-index="{{ index }}"
class="van-ellipsis van-tab {{ index === active ? 'van-tab--active' : '' }} {{ item.disabled ? 'van-tab--disabled' : '' }}"
style="{{ color && (index === active) !== (type === 'card') && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }}"
style="{{ color && index !== active && type === 'card' && !item.disabled ? 'color: ' + color : '' }} {{ color && index === active && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }}"
bind:tap="onTap"
>
{{ item.title }}