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: { 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;