更新记录
1.0.1(2024-12-02) 下载此版本
无
1.0.0(2024-12-02) 下载此版本
无
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | - | - | - | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | - | - | - | - | - | - | - | - | - | - |
组件参数文档
该文档说明了组件的所有可用参数以及其类型、默认值和用途。
参数列表
参数名称 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
modelValue |
绑定值 | String | Number |
无 | 无 |
height |
组件高度 | String | Number |
无 | 80 |
list |
标签列表 | Array (Item[] ) |
无 | [] |
loop |
是否循环显示 | Boolean |
true | false |
true |
fill |
标签是否填充 | Boolean |
true | false |
false |
justify |
标签水平布局 | String |
'start' | 'center' | 'end' |
'start' |
gutter |
标签间隔 | Number |
无 | 30 |
color |
选中标签的颜色 | String |
无 | "" |
unColor |
未选中标签的颜色 | String |
无 | "#000000" |
backgroundColor |
背景色 | String |
无 | "#fff" |
showDropdown |
是否显示下拉按钮 | Boolean |
true | false |
无 |
showLine |
是否显示下划线 | Boolean |
true | false |
true |
lineWidth |
下划线宽度 | Number |
无 | 24 |
lineHeight |
下划线高度 | Number |
无 | 2 |
lineColor |
下划线颜色 | String |
无 | "#6b69f8" |
showslider |
是否显示滑块 | Boolean |
true | false |
false |
checkable |
是否可选 | Boolean |
true | false |
无 |
disabled |
是否禁用 | Boolean |
true | false |
无 |
使用示例
<template>
<view class="container">
<view class="card">
<view class="card-head">基础用法</view>
<view class="card-content">
<rui-tabs v-model="current" :list="list"></rui-tabs>
</view>
</view>
<view class="card">
<view class="card-head">居中</view>
<view class="card-content">
<rui-tabs v-model="current" :list="list.slice(0,4)" justify="center"></rui-tabs>
</view>
</view>
<view class="card">
<view class="card-head">填充</view>
<view class="card-content">
<rui-tabs v-model="current" :list="list.slice(0,4)" fill></rui-tabs>
</view>
</view>
<view class="card">
<view class="card-head">滑块</view>
<view class="card-content">
<rui-tabs v-model="current" :list="list" :showLine="false" showslider></rui-tabs>
</view>
</view>
<view class="card">
<view class="card-head">自定义</view>
<view class="card-content">
<rui-tabs v-model="current" :list="list" color="red" lineColor="red" :lineWidth="10" :lineHeight="2"></rui-tabs>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
const current = ref(3)
const list = ref([
{ label: "全部", value: '1' },
{ label: "电子产品", value: '2' },
{ label: "家用电器", value: '3' },
{ label: "办公用品", value: '4' },
{ label: "汽车用品", value: '5' },
{ label: "书籍", value: '6' },
{ label: "家具", value: '7' },
{ label: "运动户外", value: '8' },
{ label: "美容护理", value: '9' },
{ label: "玩具", value: '10' },
])
</script>