更新记录
1.0.0(2025-12-29)
下载此版本
master
平台兼容性
uni-app(4.13)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| √ |
√ |
√ |
√ |
√ |
- |
√ |
√ |
√ |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
其他
安装
在市场导入xf-radio-groupuni_modules版本的即可,无需import
组件关联说明
基本用法
- 该组件主要用于xf-picker选择器;
- 使用组件代码如下:
<template>
<xf-popup v-model:show="show" title="标题">
<scroll-view class="xf-col" style="max-height: calc(82vh - 60px);min-height: 50vh" scroll-y>
<xf-radio-group v-model="selectedValue" :list="singleLists" labelKey="labelKey"
valueKey="valueKey" @itemClick="itemClick"></xf-radio-group>
</scroll-view>
</xf-popup>
</template>
<script setup lang="ts">
import { onReady, onShow, onBackPress } from '@dcloudio/uni-app'
import { onMounted, ref, watch } from 'vue';
const selectedValue = ref()
const modelValue = defineModel<string | any | number>('modelValue');
const singleLists = ref([
{
label: '选项1',
value: 1,
},
{
label: '选项2',
value: 2
},
{
label: '选项3',
value: 3
},
]);
const itemClick = (item : any, index : number) => {
}
</script>
API
Props
| 属性名 |
说明 |
类型 |
默认值 |
| v-model:modelValue |
当前选中项对应的值 |
string|any|number |
- |
| customStyle |
自定义style |
string |
- |
| customClass |
自定义class |
string |
- |
| list |
列表数据 |
array |
- |
| labelKey |
列表对象的key字段名 |
string |
label |
| valueKey |
列表对象的value字段名 |
string |
value |
事件 Emits
| 事件名 |
说明 |
返回值 |
| itemClick |
点击并获取当前选中的item对象及index |
|