make upload creat url for all file (#1530)

pull/1543/head
baiyaaaaa 2016-12-04 10:21:53 +08:00 committed by cinwell.li
parent 7a85d55f31
commit 78a460ac9e
1 changed files with 19 additions and 21 deletions

View File

@ -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;