更新记录
1.2.0(2024-12-13) 下载此版本
解决报错、优化展示
1.1.0(2024-12-13) 下载此版本
优化效果
1.0.1(2023-11-05) 下载此版本
样式
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | √ | √ | √ | √ |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
支持扫码体验-见右侧二维码
<template>
<view>
<select-tab style="width: 100%;" :selectTypeId="selectTypeId" :hasLaunch="hasLaunch" :selectType="selectType"
:labelKey="labelKey" :list="list" @handleSelectTab="handleSelectTab" />
</view>
</template>
<script>
export default {
data() {
return {
hasLaunch: true,
selectType: '',
selectTypeId: '_id',
labelKey: "category",
list: [{
_id: '',
category: '最新',
}, {
_id: 'thumbs',
category: '精选',
}, {
_id: 'downLoad',
category: '热门',
}, {
_id: '1',
category: '治愈',
}, {
_id: '2',
category: '落日',
}, {
_id: '3',
category: '晚霞',
}, {
_id: '4',
category: '风景',
}],
};
},
methods: {
handleSelectTab(item) {
if (this.selectType !== item[this.selectTypeId]) {
this.selectType = item[this.selectTypeId]
}
}
},
}
</script>
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
list | Array | [] | tab 列表数据 |
selectType | String | '' | 选中的 tab 的 ID |
selectTypeId | String | '_id' | tab 的 ID 的 key |
labelKey | String | 'category' | tab 展示字段 |
hasLaunch | Boolean | false | 标签是否可以下拉 |