// 表格导出功能
downOrderTable(){
let order = XLSX.utils.table_to_book(document.getElementById("orderTable")); //此处传入table的DOM节点
let orderXlsx = XLSX.write(order, {
bookType: "xlsx",
bookSST: true,
type: "array"
})
try {
FileSaver.saveAs(
new Blob([orderXlsx], {
type: "application/octet-stream"
}),
`订单列表.xlsx`
); //导出的文件名
} catch (e) {
console.log(e, orderXlsx);
}
return orderXlsx;
}
JS当前表格下载功能
最新推荐文章于 2024-08-22 10:51:05 发布