更新记录
1.0.3(2026-05-25)
备注说明
1.0.2(2026-05-25)
备注说明
1.0.1(2026-05-25)
备注说明
查看更多平台兼容性
uni-app x(4.63)
| Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| × | × | × | × | √ | × |
an-media-photo
开发文档
UTS 语法 UTS API插件 UTS uni-app兼容模式组件 UTS 标准模式组件 Hello UTS
插件说明
该插件只支持鸿蒙,
权限说明
该插件使用鸿蒙内部安全模块,不需要任何权限
插件参数说明
| 参数 | 默认值 | 参数说明 | 返回说明 |
|---|---|---|---|
| width | 100% | 相册选择器宽度 | - |
| height | 100% | 相册选择器高度 | - |
| pickerOptions | - | 鸿蒙原生组件配置 | - |
| pickerOptions.backgroundColor | #fff | 背景颜色 | - |
| pickerOptions.isSearchSupported | false | 是否有输入框,默认 | - |
| pickerOptions.maxPhotoSelectNumber | 8 | 单次选择的图片数量,(鸿蒙组件实际会加1个) | - |
| pickerOptions.maxVideoSelectNumber | 8 | 单次选择的视频数量,默认8,(鸿蒙组件实际会加1个) | - |
| pickerOptions.selectMode | 1 | 选择模式,0单选。1多选 | - |
| pickerOptions.checkBoxColor | #009BED | 勾选框的背景色 | - |
| pickerOptions.isPhotoTakingSupported | false | 是否支持拍照 | - |
| pickerOptions.MIMEType | / | 文件类型.图片(image/),视频(video/),动态图(image/movingPhoto),图片/视频(/) | - |
| @onSelect | - | 选择文件时候的回调 | 返回uri地址 |
| @onDeselect | - | 删除文件时候的回调 | 返回uri地址 |
| @change | - | 选择文件变化时候的回调 | 返回uri地址的数组 |
| @onError | - | 组件加载失败时候的回调 | 返回any类型 |
组件插槽
| 插槽 | 插槽说明 |
|---|---|
| top | 组件顶部的插槽 |
| bottom | 组件底部的插槽 |
基本使用方式
<an-media-photo @onSelect="" @change="change" height="100%">
<template #top>
自定义头部
</template>
<template #bottom>
自定义底部
</template>
</an-media-photo>
<script setup lang="uts">
const src = ref<string>('')
const fileList = ref<string[]>([])
const = (e:string) => {
console.log(e)
src.value = e;
}
const change = (file:string[]) => {
console.log(file)
fileList.value = file;
console.log(fileList.value)
}
</script>

收藏人数:
购买源码授权版(
试用
赞赏(0)
下载 129
赞赏 4
下载 12034857
赞赏 1917
赞赏
京公网安备:11010802035340号