<el-button class="yellow fl" @click="exportExcel">导出</el-button>
import FileSaver from 'file-saver'
import XLSX from 'xlsx'
exportExcel() {
/* generate workbook object from table */
var wb = XLSX.utils.table_to_book(document.querySelector('#exporttab'));
console.log(wb);
// delete wb.Sheets.Sheet1.(G1);
// console.log(wb)
/* get binary string as output */
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), 'students.xlsx')
} catch (e) { if (typeof console !== 'undefined') console.log(e, wbout) }
return wbout
},