feat: implement custom mini-program tab bar
This commit is contained in:
20
mini/custom-tab-bar/index.wxml
Normal file
20
mini/custom-tab-bar/index.wxml
Normal file
@@ -0,0 +1,20 @@
|
||||
<view class="custom-tab-bar">
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:key="pagePath"
|
||||
class="custom-tab-bar__item"
|
||||
data-index="{{index}}"
|
||||
bindtap="switchTab"
|
||||
>
|
||||
<image
|
||||
class="custom-tab-bar__icon"
|
||||
src="{{selected === index ? item.selectedIconPath : item.iconPath}}"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text
|
||||
class="custom-tab-bar__label {{selected === index ? 'custom-tab-bar__label--active' : ''}}"
|
||||
>
|
||||
{{item.text}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user