covert-json-to-excel
Version:
传入json,可自定义表格标题名称和列数、头部名称、过滤列和绑定生成开始与成功的回调函数
49 lines (45 loc) • 893 B
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo</title>
</head>
<body>
</body>
<script src="../dist/index.js"></script>
<script>
const data = [
{
name: "哈哈",
age: 1,
sex: "男",
companyName: "公司1",
companyAddress: "公司地址1"
},
{
name: "呵呵",
age: 2,
sex: "女",
companyName: "公司2",
companyAddress: "公司地址2"
},
{
name: "嘻嘻",
age: 3,
sex: "男",
companyName: "公司3",
companyAddress: "公司地址3"
},
{
name: "啦啦",
age: 4,
sex: "女",
companyName: "公司4",
companyAddress: "公司地址4"
}
];
const json2excel = new customJson2excel({ data });
json2excel.generate();
</script>
</html>