mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
[new feature] Tabs: add title-active-color、title-inactive-color prop (#2773)
This commit is contained in:
@@ -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 + '%';
|
||||
}
|
||||
|
Reference in New Issue
Block a user