tabbar 调整
This commit is contained in:
parent
e375feaec4
commit
3d03d5a3f1
|
|
@ -12,6 +12,8 @@ export default OakComponent({
|
|||
color: '#666',
|
||||
selectedColor: '',
|
||||
border: false,
|
||||
selectedIconPath: '',
|
||||
iconPath: '',
|
||||
},
|
||||
lifetimes: {
|
||||
show() {
|
||||
|
|
@ -33,7 +35,10 @@ export default OakComponent({
|
|||
let index;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const pagePath = list[i].pagePath;
|
||||
const pathname = this.features.navigator.getPathname(pagePath, namespace);
|
||||
const pathname = this.features.navigator.getPathname(
|
||||
pagePath,
|
||||
namespace
|
||||
);
|
||||
if (pathname === currentPagePath) {
|
||||
index = i;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@
|
|||
<!-- 标签图标 -->
|
||||
<l-badge show="{{item.redDot}}" dot="{{item.redDot===true}}" value="{{item.redDot}}" data-index="{{index}}" mut-bind:lintap="onTapItem">
|
||||
<block wx:if="{{selectedIndex===index}}">
|
||||
<block wx:if="{{item.selectedIconPath}}">
|
||||
<block wx:if="{{ selectedIconPath }}">
|
||||
<image class="tab-bar__item-image" src={{selectedIconPath}} style="{{item.iconSize ? 'width: '+item.iconSize+ 'rpx;' : ''}} {{item.iconSize ? 'height: '+item.iconSize+ 'rpx;' : ''}}" />
|
||||
</block>
|
||||
<block wx:elif="{{item.selectedIconPath}}">
|
||||
<image class="tab-bar__item-image" src={{item.selectedIconPath}} style="{{item.iconSize ? 'width: '+item.iconSize+ 'rpx;' : ''}} {{item.iconSize ? 'height: '+item.iconSize+ 'rpx;' : ''}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ export default OakComponent({
|
|||
color: '#666',
|
||||
selectedColor: '',
|
||||
border: false,
|
||||
selectedIconPath: '', //一般在list设置
|
||||
iconPath: '',
|
||||
},
|
||||
lifetimes: {
|
||||
show() {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,12 @@
|
|||
<!-- 标签图标 -->
|
||||
<l-badge show="{{item.redDot}}" dot="{{item.redDot===true}}" value="{{item.redDot}}" data-index="{{index}}" mut-bind:lintap="onTapItem">
|
||||
<block wx:if="{{selectedIndex===index}}">
|
||||
<block wx:if="{{item.selectedIconPath}}">
|
||||
<image class="tab-bar__item-image" src={{item.selectedIconPath}} style="{{item.iconSize ? 'width: '+item.iconSize+ 'rpx;' : ''}} {{item.iconSize ? 'height: '+item.iconSize+ 'rpx;' : ''}}" />
|
||||
</block>
|
||||
<block wx:if="{{ selectedIconPath }}">
|
||||
<image class="tab-bar__item-image" src={{selectedIconPath}} style="{{item.iconSize ? 'width: '+item.iconSize+ 'rpx;' : ''}} {{item.iconSize ? 'height: '+item.iconSize+ 'rpx;' : ''}}" />
|
||||
</block>
|
||||
<block wx:elif="{{item.selectedIconPath}}">
|
||||
<image class="tab-bar__item-image" src={{item.selectedIconPath}} style="{{item.iconSize ? 'width: '+item.iconSize+ 'rpx;' : ''}} {{item.iconSize ? 'height: '+item.iconSize+ 'rpx;' : ''}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<oak-icon name="{{item.selectedIconName}}" size="{{item.iconSize || 24}}" color="{{selectedColor}}" />
|
||||
</block>
|
||||
|
|
|
|||
Loading…
Reference in New Issue