Commit 4d2fac6f authored by thegatheringstorm's avatar thegatheringstorm Committed by 杨奕

Upload: convert var to const and let

parent 6e3f46a5
......@@ -139,13 +139,13 @@ export default {
this.onChange(file, this.uploadFiles);
},
handleProgress(ev, rawFile) {
var file = this.getFile(rawFile);
const file = this.getFile(rawFile);
this.onProgress(ev, file, this.uploadFiles);
file.status = 'uploading';
file.percentage = ev.percent || 0;
},
handleSuccess(res, rawFile) {
var file = this.getFile(rawFile);
const file = this.getFile(rawFile);
if (file) {
file.status = 'success';
......@@ -156,8 +156,8 @@ export default {
}
},
handleError(err, rawFile) {
var file = this.getFile(rawFile);
var fileList = this.uploadFiles;
const file = this.getFile(rawFile);
const fileList = this.uploadFiles;
file.status = 'fail';
......@@ -171,13 +171,13 @@ export default {
file = this.getFile(raw);
}
this.abort(file);
var fileList = this.uploadFiles;
let fileList = this.uploadFiles;
fileList.splice(fileList.indexOf(file), 1);
this.onRemove(file, fileList);
},
getFile(rawFile) {
var fileList = this.uploadFiles;
var target;
let fileList = this.uploadFiles;
let target;
fileList.every(item => {
target = rawFile.uid === item.uid ? item : null;
return !target;
......@@ -209,7 +209,7 @@ export default {
},
render(h) {
var uploadList;
let uploadList;
if (this.showFileList) {
uploadList = (
......@@ -223,7 +223,7 @@ export default {
);
}
var uploadData = {
const uploadData = {
props: {
type: this.type,
drag: this.drag,
......
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