组件服务器 d,小程序通用型图片上传服务器组件

更新记录

v1.3(2020-08-28)

1.去除引入的icon.css,防止启动报错

2.js的引入路径大家自定义一下哈

v1.2(2020-08-27)

1.修改v1.1版本新增的编辑场景的bug

2.增加在同一页面多次复用同一组件需要进行 $ref进行绑定的说明;

3.在使用过程中请在下面留言邮箱号进行问题沟通回复,谢谢!

查看更多

upload-picture 组件page中使用方法

使用方法

:bizType='bizType' :limitSize='limitSize' @update:imageList="updateImageList" :imageList.sync="imageList">

//特别提醒:

//在同一页面使用多个相同组件时需要进行ref绑定取值

:limitCount='limitCount' :sizeType='sizeType' :sourceType='sourceType'

:bizType='bizType' ref='contractVoucher' :limitSize='limitSize' :imageList.sync="contractImageList">

:limitCount='limitCount' :sizeType='sizeType' :sourceType='sourceType'

:bizType='bizType' ref='paymentVoucher' :limitSize='limitSize' :imageList.sync="contractImageList">

this.imgListA = this.$refs.contractVoucher.imgList

this.imgListB = this.$refs.paymentVoucher.imgList

//在data中绑定

//imageList 对应上边绑定的imageList

//@update:imageList="updateImageList" 动态事件,支持动态实时获取图片数组

// updateImageList(list){

// this.imgList = list

//}

data() {

return {

//使用场景,支持新增上传场景及编辑图片场景,新增-add,编辑-edit

type:'add',

// 服务器文件夹,可以指定某特定业务上传到服务器那个文件夹下,便于查找

bizType:'market',

//限制图片大小,单位M

limitSize:3,

//连续选择上传的数量,默认是9

limitCount:'3',

// 上传服务器成功后组件返回的url数组

imageList: [],

//可以指定是原图还是压缩图,默认二者都有

sizeType:['original', 'compressed'],

//从相册和文件选择,默认二者都有

sourceType:['album', 'camera'],

}

},

参数

类型

是否必填

参数描述

type

String

组件使用场景,add新增 edit编辑

imageList

Array

图片数据展示(暂不支持视频)

limitCount

Number

上传图片最大个数

limitSize

Number

上传大小(默认为3M)

sizeType

Array

指定原图还是压缩图

sourceType

Array

指定来源,相机或者文件

bizType

String

服务器文件夹,建议自己定义,默认market

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值