fix file not remote when before-upload reject

pull/3610/head
baiyaaaaa 2017-03-20 11:34:12 +08:00 committed by 杨奕
parent a50fcfd9c7
commit 8523865056
2 changed files with 7 additions and 4 deletions

View File

@ -160,7 +160,10 @@ export default {
this.onError(err, file, this.uploadFiles);
this.onChange(file, this.uploadFiles);
},
handleRemove(file) {
handleRemove(file, raw) {
if (raw) {
file = this.getFile(raw);
}
var fileList = this.uploadFiles;
fileList.splice(fileList.indexOf(file), 1);
this.onRemove(file, fileList);
@ -181,7 +184,7 @@ export default {
this.uploadFiles
.filter(file => file.status === 'ready')
.forEach(file => {
this.$refs['upload-inner'].upload(file.raw, file);
this.$refs['upload-inner'].upload(file.raw);
});
},
getMigratingConfig() {

View File

@ -85,12 +85,12 @@ export default {
this.post(rawFile);
}
}, () => {
if (file) this.onRemove(file);
this.onRemove(rawFile, true);
});
} else if (before !== false) {
this.post(rawFile);
} else {
if (file) this.onRemove(file);
this.onRemove(rawFile, true);
}
},
post(rawFile) {