async和await必须成对出现,示例:
function file2txtArr(file) {
var fr = new FileReader;
fr.readAsText(file);
return new Promise((resolve) => {
fr.onload = function() {
resolve(this.result.split('\n'));
}
});
}
async function(){
let file = this.$refs.upload.$refs['upload-inner'].$refs.input;
let loginWxArr = await file2txtArr(file.files[0]);
}