0
点赞
收藏
分享

微信扫一扫

表格(table)数据导出成Excel

使用​​xlxs-js​​库

function exportExcel () {
var wb = XLSX.utils.table_to_book(document.querySelector('.my-el-table'))
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), 'userlist.xlsx')
} catch (e) {
if (typeof console !== 'undefined') console.log(e, wbout)
}
return wbout
},

 



举报

相关推荐

0 条评论