fix: 🐛 修复 Upload 开启 multiple 后只能成功上传最后一个文件的问题 (#1044)

 Closes: #1043
This commit is contained in:
不如摸鱼去 2025-05-08 15:09:04 +08:00 committed by GitHub
parent eea9bf7aac
commit f2ae0d3aac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 14 deletions

View File

@ -43,6 +43,10 @@
<demo-block :title="$t('jinYong')">
<wd-upload :file-list="fileList8" disabled :action="action" @change="handleChange8"></wd-upload>
</demo-block>
<demo-block :title="$t('duo-xuan')">
<wd-upload :file-list="fileList2" multiple :action="action" @change="handleChange2"></wd-upload>
</demo-block>
<demo-block :title="$t('zi-ding-yi-huan-qi-shang-chuan-yang-shi-bing-xian-zhi-shang-chuan-5-zhang')">
<wd-upload :file-list="fileList9" :action="action" @change="handleChange9" :limit="5">
<wd-button>{{ $t('zi-ding-yi-huan-qi-yang-shi') }}</wd-button>
@ -243,16 +247,6 @@ const buildFormData = ({ file, formData, resolve }: any) => {
resolve(formData)
}
const handleSuccess1 = (res: any) => {
console.log('成功', res)
}
const handleFail1 = (res: any) => {
console.log('失败', res)
}
const handleProgess1 = (res: any) => {
console.log('加载中', res)
}
function handleSuccess(event: any) {
console.log('成功', event)
}

View File

@ -288,8 +288,7 @@ function startUploadFiles() {
uploadMethod,
onSuccess: handleSuccess,
onError: handleError,
onProgress: handleProgress,
abortPrevious: true //
onProgress: handleProgress
})
}
})
@ -305,8 +304,7 @@ function startUploadFiles() {
uploadMethod,
onSuccess: handleSuccess,
onError: handleError,
onProgress: handleProgress,
abortPrevious: true
onProgress: handleProgress
})
}
}