fix: 修复文件上传一直出现loading的情况

This commit is contained in:
kuaifan 2022-02-10 20:33:14 +08:00
parent 96580e2284
commit c117e4b087
5 changed files with 20 additions and 8 deletions

View File

@ -224,9 +224,12 @@
this.$refs.upload.fileList.splice(fileList.indexOf(item), 1); this.$refs.upload.fileList.splice(fileList.indexOf(item), 1);
this.$emit('input', this.$refs.upload.fileList); this.$emit('input', this.$refs.upload.fileList);
}, },
handleProgress() { handleProgress(event, file) {
// //
this.$emit('update:uploadIng', this.uploadIng + 1); if (file._uploadIng === undefined) {
file._uploadIng = true;
this.$emit('update:uploadIng', this.uploadIng + 1);
}
}, },
handleSuccess (res, file) { handleSuccess (res, file) {
// //

View File

@ -248,9 +248,12 @@
/********************文件上传部分************************/ /********************文件上传部分************************/
handleProgress() { handleProgress(event, file) {
// //
this.uploadIng++; if (file._uploadIng === undefined) {
file._uploadIng = true;
this.uploadIng++;
}
}, },
handleSuccess(res, file) { handleSuccess(res, file) {

View File

@ -474,9 +474,12 @@
/********************文件上传部分************************/ /********************文件上传部分************************/
handleProgress() { handleProgress(event, file) {
// //
this.uploadIng++; if (file._uploadIng === undefined) {
file._uploadIng = true;
this.uploadIng++;
}
}, },
handleSuccess(res, file) { handleSuccess(res, file) {

View File

@ -79,7 +79,7 @@ export default {
methods: { methods: {
handleProgress(event, file) { handleProgress(event, file) {
// //
if (typeof file.tempId === "undefined") { if (file.tempId === undefined) {
file.tempId = $A.randomString(8); file.tempId = $A.randomString(8);
this.$emit('on-progress', file); this.$emit('on-progress', file);
} }

View File

@ -1206,7 +1206,10 @@ export default {
handleProgress(event, file, fileList) { handleProgress(event, file, fileList) {
// //
this.uploadIng++; if (file._uploadIng === undefined) {
file._uploadIng = true;
this.uploadIng++;
}
this.uploadUpdate(fileList); this.uploadUpdate(fileList);
}, },