更新记录
1.0.0.4(2026-01-06) 下载此版本
1
1.0.0.3(2026-01-06) 下载此版本
master
1.0.0.2(2026-01-06) 下载此版本
master
查看更多平台兼容性
uni-app(4.13)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| √ | √ | √ | √ | √ | - | √ | √ | √ |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|
| √ | - | - | - | - | - | - | - | - | - | - |
其他
| 多语言 | 暗黑模式 | 宽屏模式 |
|---|---|---|
| × | × | √ |
安装
在市场导入xf-pickeruni_modules版本的即可,无需import
组件关联说明
代码演示
基本用法
- 基础页面使用组件代码如下:
表单基础用法
<template>
<view class="xf-full main">
<scroll-view class="scroll xf-col-center xf-full-height" scroll-y>
<view style="width: 100%;">
<xf-picker v-model:modelValue="modelValue" pickerTitle="单选ActionSheet" pickerTip="副标题" required
:list="list" hasFooterBtn title="这是一段描述信息" @selector="selector">
</xf-picker>
</view>
</scroll-view>
</view>
</template>
自定义插槽用法法
<template>
<view class="xf-full main">
<scroll-view class="scroll xf-col-center xf-full-height" scroll-y>
<view style="width: 100%;">
<xf-picker v-model:show="show" v-model:modelValue="modelValue" pickerTitle="单选ActionSheet"
pickerTip="副标题" required :list="list" hasFooterBtn title="这是一段描述信息" @selector="selector">
<template #content>
<xf-fm-select title="标题" @click="show = true" v-model:value="formValueText"> </xf-fm-select>
</template>
</xf-picker>
</view>
</scroll-view>
</view>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
const modelValue = ref(1)
const show = ref(false)
const list = ref([
{
label: "选项1",
value: 1,
tip: '副标题'
},
{
label: "选项2",
value: 2,
tip: '副标题'
},
{
label: "选项3",
value: 3,
tip: '副标题'
}
])
const formValueText = computed(() => {
return list.value.find(e => e.value == modelValue.value).label
})
const selector = (e) => {
console.log(e)
// console.log(modelValue)
}
</script>
<style lang="scss" scoped>
.main {}
</style>
API
Props
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| v-model:modelValue | 当前选中的value | string | - |
| v-model:show | 自定义插槽时,是否打开弹窗 | boolean | false |
| pickerTitle | 表单标题 | string | - |
| pickerBottomTip | 表单标题下面提示语 | object|string |
- |
| pickerTip | 表单提示语 | string | - |
| required | *是否必填 | boolean | false |
| list | 展示列表 | string | - |
| title | 弹框标题 | string | - |
| valueKey | 列表对象value值对应的key | string | value |
| labelKey | 列表对象label值对应的key | string | label |
| tipKey | item副标题对应的key | string | tip |
| hasFooterBtn | 是否显示取消按钮 | boolean | false |
外部调用事件 Expose
| 事件名 | 说明 | 返回值 |
|---|---|---|
| selector | 选中后回调事件 |
插槽 slot
| 名称 | 说明 | 返回值 |
|---|---|---|
| content | 当不是表单组件时,用于自定义 |

收藏人数:
下载插件并导入HBuilderX
赞赏(0)
下载 286
赞赏 0
下载 13049361
赞赏 1841
赞赏
京公网安备:11010802035340号