Commit 5ae443a4 authored by Harlan's avatar Harlan Committed by hetech

Upload: optimize code (#13973)

parent 6231a393
......@@ -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;
});
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment