XLSX.utils.sheet_to_json解析excel
来源于 :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)
};
};
用空常来坐坐
https://www.cnblogs.com/alexgl2008/

浙公网安备 33010602011771号