p-export-excel
v1.0.0
Published
p-export-excel
Downloads
7
Readme
p-export-excel 官方文档
安装引入
npm安装
npm i p-export-excel
import pExportExcel from "p-export-excel";
cdn引入
<script src="https://unpkg.com/[email protected]/lib/p-export-excel.js"></script>
使用示例
let ShowLabel = [[{ text: '学员姓名' }, { text: '手机号' }]];
let list = []
for (let i = 0; i < 5; i++) {
list.push([{
text: "学员" + i
}, {
text: 18800000000 + i,
style: "color:red"
}])
}
list.push([{
text: "注:此数据为p-export-excel测试数据!",
colspan: "2",
align: "left"
}])
pExportExcel({
fileName: "学员统计表",
theadList: ShowLabel,
tbodyList: list
})
配置项
excel配置项
fileName--文件名 footName--表名 theadList--表头信息 tbodyList--内容数据信息
单元格配置项
text--内容 colspan--水平合并单元格 rowspan--垂直合并单元格 style--样式 align--对齐方式