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

Upload: optimize code (#13973)

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