File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -151,12 +151,14 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
151
151
| Attribute | Description | Type | Default |
152
152
| ------| ------| ------| ------|
153
153
| v-model | Index of active tab | ` String ` ` Number ` | ` 0 ` |
154
- | color | Tab color | ` String ` | ` #f44 ` |
155
154
| type | Can be set to ` line ` ` card ` | ` String ` | ` line ` |
156
155
| duration | Toggle tab's animation time | ` Number ` | ` 0.3 ` | - |
157
156
| background | Background color | ` String ` | ` white ` |
158
157
| line-width | Width of tab line (px) | ` Number ` | Width of active tab |
159
158
| line-height | Height of tab line (px) | ` Number ` | 3 |
159
+ | color | Tab color | ` String ` | ` #f44 ` |
160
+ | title-active-color | Title active color | ` String ` | - |
161
+ | title-inactive-color | Title inactive color | ` String ` | - |
160
162
| swipe-threshold | Set swipe tabs threshold | ` Number ` | ` 4 ` | - |
161
163
| sticky | Whether to use sticky mode | ` Boolean ` | ` false ` |
162
164
| offset-top | Offset top when use sticky mode | ` Number ` | ` 0 ` |
Original file line number Diff line number Diff line change @@ -155,12 +155,14 @@ export default {
155
155
| 参数 | 说明 | 类型 | 默认值 | 版本 |
156
156
| ------| ------| ------| ------| ------|
157
157
| v-model | 当前标签的索引 | ` String ` ` Number ` | ` 0 ` | 1.0.6 |
158
- | color | 标签颜色 | ` String ` | ` #f44 ` | 1.2.0 |
159
158
| type | 样式类型,可选值为` card ` | ` String ` | ` line ` | - |
160
159
| duration | 动画时间,单位秒 | ` Number ` | ` 0.3 ` | - |
161
160
| background | 标签栏背景色 | ` String ` | ` white ` | 1.6.5 |
162
161
| line-width | 底部条宽度,单位 px | ` Number ` | - | 1.1.1 |
163
162
| line-height | 底部条高度,单位 px | ` Number ` | 3 | 1.5.0 |
163
+ | color | 标签主题色 | ` String ` | ` #f44 ` | 1.2.0 |
164
+ | title-active-color | 标题选中态颜色 | ` String ` | - | 1.6.5 |
165
+ | title-inactive-color | 标题默认态颜色 | ` String ` | - | 1.6.5 |
164
166
| swipeable | 是否开启手势滑动切换 | ` Boolean ` | ` false ` | 1.0.0 |
165
167
| sticky | 是否使用粘性定位布局 | ` Boolean ` | ` false ` | - |
166
168
| offset-top | 粘性定位布局下与顶部的最小距离,单位 px | ` Number ` | ` 0 ` | 1.1.15 |
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ export default sfc({
21
21
offsetTop : Number ,
22
22
swipeable : Boolean ,
23
23
background : String ,
24
+ titleActiveColor : String ,
25
+ titleInactiveColor : String ,
24
26
ellipsis : {
25
27
type : Boolean ,
26
28
default : true
@@ -362,6 +364,7 @@ export default sfc({
362
364
const active = index === this . curActive ;
363
365
const isCard = this . type === 'card' ;
364
366
367
+ // theme color
365
368
if ( color ) {
366
369
if ( ! item . disabled && isCard && ! active ) {
367
370
style . color = color ;
@@ -374,6 +377,11 @@ export default sfc({
374
377
}
375
378
}
376
379
380
+ const titleColor = active ? this . titleActiveColor : this . titleInactiveColor ;
381
+ if ( titleColor ) {
382
+ style . color = titleColor ;
383
+ }
384
+
377
385
if ( this . scrollable && this . ellipsis ) {
378
386
style . flexBasis = 88 / this . swipeThreshold + '%' ;
379
387
}
You can’t perform that action at this time.
0 commit comments