来源于 :https://www.cnblogs.com/zhenggaowei/p/11732314.html
// el-upload组件中绑定的changeFile function changeFile(file) { let f = file.raw; let reader = new FileReader(); reader.readAsBinaryString(f); reader.onload = function (e) { let data = e.target.result; let wb = XLSX.read(data, { type: 'binary' }); let json = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); console.log(json) }; };