1.0.3 • Published 2 years ago
flexible-excel v1.0.3
FLEXIBLE-EXCEL 灵活快捷的导出插件
现有导出前端库中,XLSX.JS功能强大但是操作颇为不便,在LAY-EXCEL基础上封装了此插件,无额外依赖,支持 npm 引入,导出仅需一句话。
导出excel功能基于 LAY-EXCEL.js ,XLSX.js,下载功能基于 FileSaver,读取文件基于 H5的 FileReader。
兼容性
支持IE10+、Firefox、Chrome 等
使用本项目的几种方式
npm安装
$ npm i flexible-excel
然后使用 import
引入并调用导出函数
import FLEX_EXCEL from 'flexible-excel';
FLEX_EXCEL.exportExcel('dom的id', '表格导出')
依赖的开源项目
开源项目名称 | 地址 | 用于 |
---|---|---|
SheetJS / js-xlsx | https://github.com/SheetJS/js-xlsx | 导出的基础逻辑 |
protobi / js-xlsx | https://github.com/protobi/js-xlsx | 可以设置样式,用于补全样式功能 |
FileSaver.js | https://github.com/eligrey/FileSaver.js/ | 前端用于保存文件的JS功能组件 |
Blob.js | https://github.com/eligrey/Blob.js/ | Blob在IE10中的hack实现 |
polyfill.js | https://github.com/philipwalton/polyfill/ | 有名的IE兼容插件 |
shim.js | https://github.com/es-shims/es5-shim | xlsx.js内置的兼容组件,支持ES5 |