XLSX is a powerful JS processing Excel file front-end framework, using XLSX, we in JS, do Excel export operations

Installation:

npm install --save xlsx
Copy the code

Simple use of the code:

import XLSX from 'xlsx'

var wb = XLSX.utils.book_new();

var ws_name = "SheetJS";

/* make worksheet */

var ws_data = [

    ["S"."h"."e"."e"."t"."J"."S"],

    [1.2.3.4.5]].var ws = XLSX.utils.aoa_to_sheet(ws_data);

/* Add the worksheet to the workbook */

XLSX.utils.book_append_sheet(wb, ws, ws_name);

XLSX.writeFile(wb, "test.xlsx")
Copy the code