1.0.9 • Published 5 years ago

js-excel-export v1.0.9

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

纯js导出excel

使用方法

安装

npm install js-excel-export --save

import excelExport from "js-excel-export";

const excelData = [
    [
        {
            text: "单元格内容",
            style: {
                fontSize: "20px",
                color: "red",
                background: "#fff"
            }
        }
    ]
];

excelExport(excelData, {
    excelName: "我的excel",
    worksheet: "sheet"
});

/**
 * excelData 数据格式:二维数组
 * 数组的每个元素代表excel行
 * 元素内的每个{},代表每行的列
 * text: 单元格数据内容
 * style 给单元格设置样式
 * 支持 fontSize color background
 * 
 * excelExport(excelData, config)
 * 第二个参数config 配置excel的文件名和worksheet名字
 * /

导出结果

avatar

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago