更新记录

1.0.2(2025-08-07) 下载此版本

1.增加参数说明

1.0.1(2025-08-07) 下载此版本

1.更新使用文档

1.0.0(2025-08-01) 下载此版本

V1.0版本发布

查看更多

平台兼容性

uni-app

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
× - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - -

其他

多语言 暗黑模式 宽屏模式
× ×

sk-tab-bar

基础使用

不支持与原生tabBar路由跳转使用

<template>
    <view class="bg" :style="{'--bg':outerApertureBorderColor}">
        <div class="tab-demo">
            <view class="uni-title uni-common-mt">切换弧度背景样式</view>

            <radio-group @change="radioChange" class="flex">
                <label class="flex" v-for="(item, index) in colorList" :key="item.value">
                    <view>
                        <radio :value="item.value" :checked="index === current" />
                    </view>
                    <view :style="{color:index==2?'red': item.value}">{{item.name}}</view>
                </label>
            </radio-group>
        </div>
        <sk-tab-bar :data="list" :iconBackgroundColor="iconBackgroundColor"
            :outerApertureBorderColor="outerApertureBorderColor"></sk-tab-bar>
    </view>
</template>
<script lang="ts" setup>
    import { ref } from 'vue';
    import icon1Active from "@/static/icon1.png"
    import icon1 from "@/static/66.png"
    import icon2Active from "@/static/icon2.png"
    import icon2 from "@/static/77.png"

    const colorList = ref([{
        value: '#e07800',
        name: '#e07800',
        checked: 'true'
    },
    {
        value: '#c30c00',
        name: '#c30c00'
    },
    {
        value: '#f2f3f7',
        name: '复原'
    },

    ])
    const current = ref(0)
    const list = ref([{
        icon: icon1,
        active: icon1Active,
        text: '首页',
        width: '36px',
        height: '36px',
    },
    {
        icon: icon2,
        active: icon2Active,
        text: '资源列表',
        width: '36px',
        height: '36px',
    },
    ])

    const outerApertureBorderColor = ref('#f2f3f7')
    const iconBackgroundColor = ref()

    const radioChange = (evt) => {
        for (let i = 0; i < colorList.value.length; i++) {
            if (colorList.value[i].value === evt.detail.value) {
                current.value = i;
                break;
            }
        }
        console.log(evt)
        outerApertureBorderColor.value = evt.detail.value
        // iconBackgroundColor.value = evt.detail.value
    }
</script>

API 参考

Props

属性名 类型 默认值 说明
data tabBar[] 右侧滚动内容列表
outerApertureBorderColor String #f2f3f7 按钮底层颜色,需要和page颜色相同
iconBackgroundColor String rgb(3, 3, 3) 按钮背景色

Methods

属性名 类型 说明
change Functuon tabBar点击回调

tabBar类型

属性名 类型 默认值 说明
text String 按钮文字
icon String 按钮图标
active String 当前选中的图标
width String 图标宽带
height String 图标高带

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。