[new feature] Tabs: add title-active-color、title-inactive-color prop (#2773)

This commit is contained in:
neverland
2019-02-17 20:47:04 +08:00
committed by GitHub
parent cb4127949f
commit 5591d44bda
3 changed files with 14 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ export default sfc({
offsetTop: Number,
swipeable: Boolean,
background: String,
titleActiveColor: String,
titleInactiveColor: String,
ellipsis: {
type: Boolean,
default: true
@@ -362,6 +364,7 @@ export default sfc({
const active = index === this.curActive;
const isCard = this.type === 'card';
// theme color
if (color) {
if (!item.disabled && isCard && !active) {
style.color = color;
@@ -374,6 +377,11 @@ export default sfc({
}
}
const titleColor = active ? this.titleActiveColor : this.titleInactiveColor;
if (titleColor) {
style.color = titleColor;
}
if (this.scrollable && this.ellipsis) {
style.flexBasis = 88 / this.swipeThreshold + '%';
}