* @param name 生成excel的文件名,如:interestTable.xlsx * @param tableName 表格的id,如:#tableId * */exportconstexportExcel=(name,tableName)=>{let sel=XLSX.utils.table_to_book(document.querySelector(tableName))let selIn=XLSX.write(sel,{bookType:'xlsx',bookSST:true,type:'array'})try{Fil...
<el-table id="mytable":data="userData"border> 4.设置导出的事件行为 <el-button@click="output">导出</el-button> 5.写output方法,直接复制就行了 output(){varwb=XLSX.utils.table_to_book(document.querySelector("#mytable"));//mytable为表格的id名/* get binary string as output */varwbout...