tabbar.wxml 1.0 KB
<template name="tabBar">
    <view class="tab-bar" style="color: {{tabBar.color}}; background: {{tarBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}}; {{tabBar.borderStyle? (tabBar.position=='top'? 'border-bottom: solid 1px '+tabBar.borderStyle + ';' : 'border-top: solid 1px '+tabBar.borderStyle + ';') : ''}}">
        <view>

            <view wx:for="{{tabBar.list}}" wx:key="pagePath" class='switch'>

                <navigator url="{{item.pagePath}}" open-type="redirect" class="{{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}}">
                    <image src="{{item.selectedIconPath}}" wx:if="{{item.active}}" class="img"></image>
                    <image src="{{item.iconPath}}" wx:if="{{!item.active}}" class="img"></image>
                    <text style='font-size:26rpx'>{{item.text}}</text>
                </navigator>

            </view>
            <view class="clear"></view>
        </view>

    </view>
</template>