mirror of https://github.com/ElemeFE/element
make upload creat url for all file (#1530)
parent
7a85d55f31
commit
78a460ac9e
|
@ -83,6 +83,20 @@ export default {
|
|||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
defaultFileList: {
|
||||
immediate: true,
|
||||
handler(fileList) {
|
||||
this.fileList = fileList.map(item => {
|
||||
item.status = 'finished';
|
||||
item.percentage = 100;
|
||||
item.uid = Date.now() + this.tempIndex++;
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleStart(file) {
|
||||
file.uid = Date.now() + this.tempIndex++;
|
||||
|
@ -95,13 +109,11 @@ export default {
|
|||
showProgress: true
|
||||
};
|
||||
|
||||
if (this.thumbnailMode) {
|
||||
try {
|
||||
_file.url = URL.createObjectURL(file);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
_file.url = URL.createObjectURL(file);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
this.fileList.push(_file);
|
||||
|
@ -158,20 +170,6 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
defaultFileList: {
|
||||
immediate: true,
|
||||
handler(fileList) {
|
||||
this.fileList = fileList.map(item => {
|
||||
item.status = 'finished';
|
||||
item.percentage = 100;
|
||||
item.uid = Date.now() + this.tempIndex++;
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
var uploadList;
|
||||
|
||||
|
|
Loading…
Reference in New Issue