[new feature] Tab : support custom color (#1622)

This commit is contained in:
fenghou 2018-08-13 19:41:31 +08:00 committed by 陈嘉涵
parent 8aa394b3e5
commit cf9ffa24d0
3 changed files with 5 additions and 1 deletions

View File

@ -146,6 +146,7 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
| sticky | Whether to use sticky mode | `Boolean` | `false` |
| offset-top | Offset top when use sticky mode | `Number` | `0` |
| swipeable | Whether to switch tabs with swipe gestrue in the content | `Boolean` | `false` |
| color | Set tab's title color | `String` | - |
### Tab API

View File

@ -148,6 +148,7 @@ export default {
| sticky | 是否使用粘性定位布局 | `Boolean` | `false` |
| offset-top | 粘性定位布局下与顶部的最小距离 (px) | `Number` | `0` |
| swipeable | 是否可以滑动内容切换 | `Boolean` | `false` |
| color | 设置 tab 标题的颜色 | `String` | - |
### Tab API

View File

@ -18,6 +18,7 @@
'van-tab--active': index === curActive,
'van-tab--disabled': tab.disabled
}"
:style="{ color }"
@click="onClick(index)"
>
<span class="van-ellipsis" ref="title">{{ tab.title }}</span>
@ -69,7 +70,8 @@ export default create({
offsetTop: {
type: Number,
default: 0
}
},
color: String
},
data() {