更新记录
1.0.0(2026-01-07)
下载此版本
master
平台兼容性
uni-app(4.13)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| √ |
√ |
√ |
√ |
√ |
- |
√ |
√ |
√ |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
其他
安装
在市场导入xf-uploader-placeholderuni_modules版本的即可,无需import
组件关联说明
基本用法
<template>
<view>
<xf-uploader-placeholder title="图片上传" v-model:fileList="formDataPh"></xf-uploader-placeholder>
</view>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { FileStatus, XFFileModel } from '../../../uni_modules/xf-ts/type/type-xf';
const formDataPh = ref<Array<XFFileModel>>([
{ url: 'https://cf-hz-test-01.xiaofengwang.com/order/orderNum/pic/%E8%AE%A2%E5%8D%95%E4%BF%A1%E6%81%AF_1760685017727_a_photo_3.jpeg', remarkName: '管路检测开始照片', id: null, status: FileStatus.Finished, type: 'image', source: ['album', 'camera'], isPlaceHolder: true },
{ url: '', remarkName: '设备链接照', id: null, status: FileStatus.None, type: 'image', source: ['album', 'camera'], isPlaceHolder: true },
{ url: '', remarkName: '管路检测结束照片', id: null, status: FileStatus.None, type: 'image', source: ['album', 'camera'], isPlaceHolder: true },
{ url: 'https://cf-hz-test-01.xiaofengwang.com/order/orderNum/pic/订单信息_1759999131952_cd119cd6e759abcb271fab4f83c59fa8.mp4', remarkName: '上传视频', id: 1, status: FileStatus.Finished, type: 'video', source: ['album', 'camera'], isPlaceHolder: true },
{ url: '', remarkName: '上传文件1', id: null, status: FileStatus.None, type: 'file', source: [], isPlaceHolder: true },
])
</script>
<style lang="scss" scoped>
.main-view {
position: relative;
width: 100%;
height: 100%;
background-color: $xf-page-bg;
box-sizing: border-box;
}
</style>
API
Props
| 属性名 |
说明 |
类型 |
默认值 |
| v-model:fileList |
上传的文件列表 |
array<XFFileModel> |
- |
| title |
表单标题 |
string |
标题 |
| tip |
提示内容 |
string |
- |
| required |
是否必填 |
boolean |
true |
| itemCount |
grid布局一行显示几个item |
number |
4 |
| gridColumnGap |
列间距 |
number |
10 |
| gridRowGap |
行间距 |
number |
10 |
| quality |
图片质量 |
number |
0.8 |
| ossObjectKey |
阿里云oss对象key |
string |
- |