Skip to content

Commit

Permalink
fix(TabBar): 修复文字选中颜色无法默认使用 theme-color 的问题
Browse files Browse the repository at this point in the history
close #1521
  • Loading branch information
smileShirmy committed Jul 10, 2022
1 parent 15fe5e8 commit 3d5bce6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tab-bar/index.js
Expand Up @@ -24,7 +24,7 @@ Component({
// 文字选中颜色
textSelectedColor: {
type: String,
value: '#3963bc'
value: ''
},
// 文字未选中颜色
textColor: {
Expand Down
4 changes: 4 additions & 0 deletions src/tab-bar/index.less
Expand Up @@ -45,3 +45,7 @@
font-size: 24rpx;
line-height: 1;
}

.@{component}__item-text--selected {
color: @theme-color;
}
2 changes: 1 addition & 1 deletion src/tab-bar/index.wxml
Expand Up @@ -7,7 +7,7 @@
<image class="lu-tab-bar__item-image {{selectedIndex===index?'lu-tab-bar__item-image--selected':''}}" src="{{selectedIndex===index?item.selectedIconPath:item.iconPath}}"></image>
</l-badge>
<!-- 标签文字 -->
<view wx:if="{{item.text!==undefined}}" class="lu-tab-bar__item-text {{selectedIndex===index?'lu-tab-bar__item-text--selected':''}}" style="color:{{selectedIndex===index?textSelectedColor:textColor}}">
<view wx:if="{{item.text!==undefined}}" class="lu-tab-bar__item-text {{selectedIndex===index?'lu-tab-bar__item-text--selected':''}}" style="{{selectedIndex===index?textSelectedColor?'color:'+textSelectedColor:'':'color:'+textColor}}">
{{item.text}}
</view>
</view>
Expand Down

0 comments on commit 3d5bce6

Please sign in to comment.