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);
|
||||
},
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue