上传组件限制
This commit is contained in:
@@ -88,8 +88,10 @@ export default {
|
||||
this.$emit('list', this.fileList)
|
||||
},
|
||||
upload(wait) {
|
||||
let count = this.limit - (this.fileList?.length||0)
|
||||
if(count>0){
|
||||
let params = {
|
||||
count: this.limit,
|
||||
count,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: [this.sourceType].flat(),
|
||||
success: (res) => {
|
||||
@@ -114,6 +116,10 @@ export default {
|
||||
} else {
|
||||
uni.chooseFile(params)
|
||||
}
|
||||
}else{
|
||||
this.$u.toast(`不能超过${this.limit}个`)
|
||||
}
|
||||
|
||||
},
|
||||
uploadFile(img) {
|
||||
if (this.size > 0 && img.size > this.size) {
|
||||
|
||||
Reference in New Issue
Block a user