fix "clearFiles" to avoid clear "uploadFiles" errors in uploading multiple files

## 修复clearFiles方法,避免同时上传多个文件时,清除uploadFiles列表,导致正在上传中的文件再上传完成后产生报错的问题

## Machine Translation:
Repair the clearfiles method to avoid clearing the uploadfiles list when multiple files are uploaded at the same time, resulting in an error message after the files being uploaded are uploaded again
pull/18518/head
高奕GaoYi 2019-12-25 10:18:00 +08:00 committed by GitHub
parent 6ec5f8e900
commit 9116ae75f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -236,8 +236,15 @@ export default {
abort(file) {
this.$refs['upload-inner'].abort(file);
},
clearFiles() {
this.uploadFiles = [];
clearFiles(status = ['success', 'fail']) {
let n;
this.uploadFiles = this.uploadFiles.filter(row => {
n = 0;
status.forEach(item => {
n += row.status === item;
});
return !n;
});
},
submit() {
this.uploadFiles