Skip to content

Commit

Permalink
feat: tabs增加配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Sep 29, 2020
1 parent e0792d9 commit ef3c50e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/pi-tabs/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<view>
<view class="pi-tabs" :class="[customClass]">
<view class="pi-tabs" :style="[customStyle]" :class="[customClass]">
<scroll-view class="pi-scroll" :scroll-left="scrollLeft" scroll-x scroll-with-animation>
<view class="scroll-wrap" :style="[scrollWrapStyle]">
<view
Expand All @@ -10,7 +10,7 @@
:style="[
getItemStyle,
itemStyle,
activeIndex === index && activeTextColor ? { color: activeTextColor } : ''
activeIndex === index && activeTextColor ? { color: activeTextColor } : {}
]"
class="pi-tab pi-align-center pi-fz-30"
:class="[{ active: activeIndex === index }]"
Expand Down Expand Up @@ -88,7 +88,7 @@ export default {
return tabs.itemPadding
}
},
// 标签是否自动撑开,(当scrollable时候生效)
// 标签是否自动撑开
stretch: {
type: Boolean,
default() {
Expand All @@ -109,11 +109,11 @@ export default {
return tabs.activeColor
}
},
// 激活颜色(不设置,默认主题色)
// 文字激活颜色(不设置,默认主题色)
activeTextColor: {
type: String,
default() {
return tabs.activeColor
return tabs.activeTextColor
}
},
// 是否显示底部的滑块
Expand Down
1 change: 1 addition & 0 deletions config/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
stretch: false, // 标签是否自动撑开,(当scrollable时候生效)
duration: 300, // 动画执行时间(毫秒)
activeColor: '', // 激活颜色(不设置,默认主题色)
activeTextColor: '', // 文字激活颜色(不设置,默认主题色)
showSliderBar: true, // 是否显示底部的滑块
showSliderBarGuide: false, // 是否显示底部滑块导轨
sliderBarWidth: '', // 底部的滑块的宽度,单位rpx(如果不设置,默认按照当前item文字的宽度去适配)
Expand Down

0 comments on commit ef3c50e

Please sign in to comment.