更新记录

2.0.1(2023-06-29)

修复vue3.0不能滑动bug

2.0.0(2023-06-21)

组件优化

1.0(2023-06-05)

初始化

查看更多

平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.8.0 app-vue app-nvue
钉钉小程序 快手小程序 飞书小程序 京东小程序
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

cc-underLineTabs

使用方法

<!-- tabIndex:选择序列 tabs:选择数组 myColor:下划线颜色 spaceLeft:tabs间距 height:设置高度 @change:tabs切换事件 -->
<cc-underLineTabs :tabIndex="tabIndex" :tabs="tabs" @change="tabChange"></cc-underLineTabs>

HTML代码实现部分

<template>
    <view class="content">
        <view style="margin: 10px;">默认设置</view>

        <!-- tabIndex:选择序列 tabs:选择数组 myColor:下划线颜色 spaceLeft:tabs间距 height:设置高度 @change:tabs切换事件 -->
        <cc-underLineTabs :tabIndex="tabIndex" :tabs="tabs" @change="tabChange"></cc-underLineTabs>

        <view style="margin: 10px;color: #88888;">设置下划线颜色</view>
        <cc-underLineTabs :tabIndex="tabIndexTwo" myColor="red" :tabs="tabs" @change="tabChangeTwo"></cc-underLineTabs>

        <view style="margin: 10px;color: #88888;">设置间距</view>
        <cc-underLineTabs :tabIndex="tabIndexThree" spaceLeft="20" :tabs="tabs"
            @change="tabChangeThree"></cc-underLineTabs>

        <view style="margin: 10px;color: #88888;">设置行高</view>
        <cc-underLineTabs :tabIndex="tabIndexfour" myColor="red" height="90" :tabs="tabs"
            @change="tabChangeFour"></cc-underLineTabs>

        <view style="height: 300px;background-color: antiquewhite;"></view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                tabIndex: 0,
                tabs: ['资讯', '体育', '视频', '直播', '凤凰卫视', '政务', '美好中国', '财经', '娱乐', '时尚', '汽车', '房产'],

                tabIndexTwo: 0,
                tabIndexThree: 0,
                tabIndexfour: 0
            }
        },

        methods: {
            tabChange(e) {
                console.log("切换tag = " + JSON.stringify(e));
                this.tabIndex = e;
            },
            tabChangeTwo(e) {
                console.log("切换tag = " + JSON.stringify(e));
                this.tabIndexTwo = e;
            },
            tabChangeThree(e) {
                console.log("切换tag = " + JSON.stringify(e));
                this.tabIndexThree = e;
            },
            tabChangeFour(e) {
                console.log("切换tag = " + JSON.stringify(e));
                this.tabIndexfour = e;
            }
        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
    }

    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }

    .text-area {
        display: flex;
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
</style>

隐私、权限声明

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

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

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

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问