files: [
vendor_path('file-saver/FileSaver.min.js'),
vendor_path('js-xlsx/dist/xlsx.core.min.js'),
]
FileSaver、js-xlsx的github,支持的版本类型,和使用方法。
filename = "ge.xlsx"
wb =
SheetNames: []
Sheets: {}
ws = sheetFromArrayOfArrays(data)
sheet_name = "ge"
wb.SheetNames.push sheet_name
wb.Sheets[sheet_name] = ws
if wb.SheetNames.length == 0
return showErr()
wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: true, type: 'binary'})
saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), filename)
FileSaver : https://github.com/eligrey/FileSaver.js/
sheetjs-js-xlsx: SheetJS js-xlsx 是 SheetJS 的社区版,是一个电子表格解析和编写库