js json=>excel
import * as XLSX from 'xlsx';
const sheetData = https://www.it610.com/article/[
{'年龄':112,'姓名':'张三'},
{'年龄':212,'姓名':'张四'}
]
const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(sheetData);
const wb: XLSX.WorkBook = XLSX.utils.book_new();
const timestamp = (new Date()).getTime();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
// XLSX.writeFile(wb, 'dataList.xlsx');
XLSX.writeFile(wb,"dataList"+timestamp+".xlsx");
推荐阅读
- ExcelPackage读取写入
- Excel|Excel 2013 新增功能之瞬间填充整列数据!
- Spring|Spring Boot之ImportSelector
- Excel基础知识-打印的那些事(上)
- 教你如何做一个好看的表格,excel使用技巧大全
- Spring注解05|Spring注解05 @Import 给容器快速导入一个组件
- javascript|vue使用js-xlsx导出excel,可修改格子样式,例如背景颜色、字体大小、列宽等
- vue|vue js-xlsx导入导出excel文件Demo
- 026-Catagory-NSString
- 1.2.1