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: {
|
methods: {
|
||||||
handleStart(file) {
|
handleStart(file) {
|
||||||
file.uid = Date.now() + this.tempIndex++;
|
file.uid = Date.now() + this.tempIndex++;
|
||||||
|
@ -95,14 +109,12 @@ export default {
|
||||||
showProgress: true
|
showProgress: true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.thumbnailMode) {
|
|
||||||
try {
|
try {
|
||||||
_file.url = URL.createObjectURL(file);
|
_file.url = URL.createObjectURL(file);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.fileList.push(_file);
|
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) {
|
render(h) {
|
||||||
var uploadList;
|
var uploadList;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue