Upload: optimize code (#13973)

pull/14392/head
Harlan 2019-02-15 16:36:24 +08:00 committed by hetech
parent 6231a39361
commit 5ae443a408
1 changed files with 2 additions and 2 deletions

View File

@ -124,15 +124,15 @@ export default {
watch: {
listType(type) {
if (type === 'picture-card' || type === 'picture') {
this.uploadFiles.forEach(file => {
this.uploadFiles = this.uploadFiles.map(file => {
if (!file.url && file.raw) {
try {
file.url = URL.createObjectURL(file.raw);
} catch (err) {
console.error('[Element Error][Upload]', err);
return;
}
}
return file;
});
}
},