按照官方demo 使用mp-uploader 组件
https://developers.weixin.qq.com/miniprogram/dev/extended/weui/uploader.html
属性有max-size 默认值为 5*1024*1024 =5242880
现在我想把他设置为4*1024*1024 = 4194304
<mp-uploader bindfail="uploadError" max-count="1" bindsuccess="uploadSuccess" select="{{selectFile}}" upload="{{uplaodFile}}" files="{{files}}" title="营业执照" tips="请上传营业执照,图片不能超过4MB"></mp-uploader>
添加 max-size="4194304" 参数后
<mp-uploader bindfail="uploadError" max-size="4194304" max-count="1" bindsuccess="uploadSuccess" select="{{selectFile}}" upload="{{uplaodFile}}" files="{{files}}" title="营业执照" tips="请上传营业执照,图片不能超过4MB"></mp-uploader>
- upload error {type: "fail", timeStamp: 180497, target: {…}, currentTarget: {…}, mark: {…}, …}
- changedTouches: undefined
- currentTarget: {id: "", dataset: {…}}
- detail: {type: 1, errMsg: "chooseImage:fail size exceed 0", total: 1, index: 0}
- mark: {}
- mut: false
- target: {id: "", dataset: {…}}
- timeStamp: 180497
- touches: undefined
- type: "fail"
- _requireActive: undefined
- __proto__: Object
去掉 max-size="4194304" 就是正常的
求解原因?
本来想发代码片段的,报太大发不了,也是醉了
谢邀:
max-size="{{maxSize}}"
maxSize=4*1024*1024
试试看。