Commit 2e9eb0f7 authored by Harlan's avatar Harlan Committed by GitHub

Upload: add url prop to upload file when list-type changed (#13771)

Upload: add url prop to upload file when list-type changed (#13771)
parents 91c40d31 c3e8b77d
......@@ -122,6 +122,20 @@ export default {
},
watch: {
listType(type) {
if (type === 'picture-card' || type === 'picture') {
this.uploadFiles.forEach(file => {
if (!file.url && file.raw) {
try {
file.url = URL.createObjectURL(file.raw);
} catch (err) {
console.error('[Element Error][Upload]', err);
return;
}
}
});
}
},
fileList: {
immediate: true,
handler(fileList) {
......
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