Skip to content

Commit f2ae0d3

Browse files
fix: 🐛 修复 Upload 开启 multiple 后只能成功上传最后一个文件的问题 (#1044)
Closes: #1043
1 parent eea9bf7 commit f2ae0d3

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

src/subPages/upload/Index.vue

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<demo-block :title="$t('jinYong')">
4444
<wd-upload :file-list="fileList8" disabled :action="action" @change="handleChange8"></wd-upload>
4545
</demo-block>
46+
<demo-block :title="$t('duo-xuan')">
47+
<wd-upload :file-list="fileList2" multiple :action="action" @change="handleChange2"></wd-upload>
48+
</demo-block>
49+
4650
<demo-block :title="$t('zi-ding-yi-huan-qi-shang-chuan-yang-shi-bing-xian-zhi-shang-chuan-5-zhang')">
4751
<wd-upload :file-list="fileList9" :action="action" @change="handleChange9" :limit="5">
4852
<wd-button>{{ $t('zi-ding-yi-huan-qi-yang-shi') }}</wd-button>
@@ -243,16 +247,6 @@ const buildFormData = ({ file, formData, resolve }: any) => {
243247
resolve(formData)
244248
}
245249
246-
const handleSuccess1 = (res: any) => {
247-
console.log('成功', res)
248-
}
249-
const handleFail1 = (res: any) => {
250-
console.log('失败', res)
251-
}
252-
const handleProgess1 = (res: any) => {
253-
console.log('加载中', res)
254-
}
255-
256250
function handleSuccess(event: any) {
257251
console.log('成功', event)
258252
}

src/uni_modules/wot-design-uni/components/wd-upload/wd-upload.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ function startUploadFiles() {
288288
uploadMethod,
289289
onSuccess: handleSuccess,
290290
onError: handleError,
291-
onProgress: handleProgress,
292-
abortPrevious: true // 自动中断之前的上传
291+
onProgress: handleProgress
293292
})
294293
}
295294
})
@@ -305,8 +304,7 @@ function startUploadFiles() {
305304
uploadMethod,
306305
onSuccess: handleSuccess,
307306
onError: handleError,
308-
onProgress: handleProgress,
309-
abortPrevious: true
307+
onProgress: handleProgress
310308
})
311309
}
312310
}

0 commit comments

Comments
 (0)