mirror of https://github.com/ElemeFE/element
Upload: convert var to const and let
parent
6e3f46a500
commit
4d2fac6f60
|
@ -139,13 +139,13 @@ export default {
|
||||||
this.onChange(file, this.uploadFiles);
|
this.onChange(file, this.uploadFiles);
|
||||||
},
|
},
|
||||||
handleProgress(ev, rawFile) {
|
handleProgress(ev, rawFile) {
|
||||||
var file = this.getFile(rawFile);
|
const file = this.getFile(rawFile);
|
||||||
this.onProgress(ev, file, this.uploadFiles);
|
this.onProgress(ev, file, this.uploadFiles);
|
||||||
file.status = 'uploading';
|
file.status = 'uploading';
|
||||||
file.percentage = ev.percent || 0;
|
file.percentage = ev.percent || 0;
|
||||||
},
|
},
|
||||||
handleSuccess(res, rawFile) {
|
handleSuccess(res, rawFile) {
|
||||||
var file = this.getFile(rawFile);
|
const file = this.getFile(rawFile);
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
file.status = 'success';
|
file.status = 'success';
|
||||||
|
@ -156,8 +156,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleError(err, rawFile) {
|
handleError(err, rawFile) {
|
||||||
var file = this.getFile(rawFile);
|
const file = this.getFile(rawFile);
|
||||||
var fileList = this.uploadFiles;
|
const fileList = this.uploadFiles;
|
||||||
|
|
||||||
file.status = 'fail';
|
file.status = 'fail';
|
||||||
|
|
||||||
|
@ -171,13 +171,13 @@ export default {
|
||||||
file = this.getFile(raw);
|
file = this.getFile(raw);
|
||||||
}
|
}
|
||||||
this.abort(file);
|
this.abort(file);
|
||||||
var fileList = this.uploadFiles;
|
let fileList = this.uploadFiles;
|
||||||
fileList.splice(fileList.indexOf(file), 1);
|
fileList.splice(fileList.indexOf(file), 1);
|
||||||
this.onRemove(file, fileList);
|
this.onRemove(file, fileList);
|
||||||
},
|
},
|
||||||
getFile(rawFile) {
|
getFile(rawFile) {
|
||||||
var fileList = this.uploadFiles;
|
let fileList = this.uploadFiles;
|
||||||
var target;
|
let target;
|
||||||
fileList.every(item => {
|
fileList.every(item => {
|
||||||
target = rawFile.uid === item.uid ? item : null;
|
target = rawFile.uid === item.uid ? item : null;
|
||||||
return !target;
|
return !target;
|
||||||
|
@ -209,7 +209,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
render(h) {
|
render(h) {
|
||||||
var uploadList;
|
let uploadList;
|
||||||
|
|
||||||
if (this.showFileList) {
|
if (this.showFileList) {
|
||||||
uploadList = (
|
uploadList = (
|
||||||
|
@ -223,7 +223,7 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var uploadData = {
|
const uploadData = {
|
||||||
props: {
|
props: {
|
||||||
type: this.type,
|
type: this.type,
|
||||||
drag: this.drag,
|
drag: this.drag,
|
||||||
|
|
Loading…
Reference in New Issue