FileSaver、js-xlsx-前端导出excel插件

FileSaver、js-xlsx的前端插件

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/

你可能感兴趣的:(Web前端,导出excel插件,FileSaver,js-xlsx)