# LAY-EXCEL 简单快捷的导出插件
现有导出前端库中,XLSX.JS功能强大但是操作颇为不便,于是封装了此插件,**无额外依赖**,支持 **npm 引入**,支持 **Layui插件形式**加载,**导出仅需一句话**。
导出excel功能基于 XLSX.js,下载功能基于 FileSaver,读取文件基于 H5的 FileReader。
**功能演示地址:** [http://excel.wj2015.com](http://excel.wj2015.com)
**文档地址:** [http://excel.wj2015.com/_book/](http://excel.wj2015.com/_book/)
![1570418356365](ScreenToGif.gif)
## 兼容性
支持IE10+、Firefox、Chrome 等
**!!! 兼容性警告: v1.7.2+ 不再支持 IE9 ,如需必须在 IE9 环境使用,请使用 v1.6.6 版本!!!**
## 快速入门
一句话导出,快速上手请查看 [『快速上手』](http://excel.wj2015.com/_book/docs/快速上手.html),更多便捷函数请查看[『函数列表』](http://excel.wj2015.com/_book/docs/函数列表/),样式设置请查看[『样式设置专区』](http://excel.wj2015.com/_book/docs/样式设置专区.html)。
## 使用本项目的几种方式
### npm安装
```shell
$ npm i lay-excel
```
然后使用 `import` 引入并调用导出函数
```js
import LAY_EXCEL from 'lay-excel';
LAY_EXCEL.exportExcel([[1, 2, 3]], '表格导出.xlsx', 'xlsx')
```
### script引入
```html
<script src="layui_exts/excel.js"></script>
<script>
LAY_EXCEL.exportExcel([[1, 2, 3]], '表格导出.xlsx', 'xlsx')
</script>
```
### Layui插件引入
```js
layui.config({
base: 'layui_exts/', // 配置一个可访问地址
}).extend({
excel: 'excel',
});
layui.use(['excel'], function (){
layui.excel.exportExcel([[1, 2, 3]], '表格导出.xlsx', 'xlsx')
})
```
## 依赖的开源项目
| 开源项目名称 | 地址 | 用于 |
| -------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------ |
| [SheetJS / js-xlsx](https://github.com/SheetJS/js-xlsx) | [https://github.com/SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx) | 导出的基础逻辑 |
| [protobi / js-xlsx](https://github.com/protobi/js-xlsx) | [https://github.com/protobi/js-xlsx](https://github.com/protobi/js-xlsx) | 可以设置样式,用于补全样式功能 |
| [FileSaver.js](https://github.com/eligrey/FileSaver.js/) | [https://github.com/eligrey/FileSaver.js/](https://github.com/eligrey/FileSaver.js/) | 前端用于保存文件的JS功能组件 |
| [Blob.js](https://github.com/eligrey/Blob.js/) | [https://github.com/eligrey/Blob.js/](https://github.com/eligrey/Blob.js/) | Blob在IE10中的hack实现 |
| [polyfill.js](https://github.com/philipwalton/polyfill/) | [https://github.com/philipwalton/polyfill/](https://github.com/philipwalton/polyfill/) | 有名的IE兼容插件 |
| [shim.js](https://github.com/es-shims/es5-shim) | [https://github.com/es-shims/es5-shim](https://github.com/es-shims/es5-shim) | xlsx.js内置的兼容组件,支持ES5 |
> 注:魔改 js-xlsx 支持样式的具体细节请见博客:[JeffreyWang的个人博客:令最新JS-XLSX支持样式的改造方法](https://blog.wj2015.com/2019/05/01/js-xlsx%E6%94%AF%E6%8C%81%E6%A0%B7%E5%BC%8F/)
## 待完成需求
- [x] 【文档】制作 Gitbook 方便查阅
- [x] 【文档】新增『参与开发』页,以便其他开发者上手此插件
- [x] 【文档】新增『常见问题整理』,整理群内高频问题,提高处理效率
- [x] 【兼容】移除 jQuery 依赖
- [ ] 【兼容】导入支持IE11(卡住)
- [x] **【兼容】兼容 npm 的方式加载**,vue demo:[lay-excel-vue](https://github.com/wangerzi/lay-excel-vue)
- [ ] 【测试】单元测试覆盖
- [ ] 【测试】建立CI/CD机制(做了一半)
- [ ] 【导出】分段递归获取数据函数封装
- [ ] 【导出】分段压缩打包
- [ ] 【导出】导出图片(卡住)
- [ ] **【导出】样式设置函数更友好**
- [ ] 【导入】导入图片(卡住)
- [ ] **【导入】优化导入处理函数**
- [ ] **【兼容】vite 打包及加载**
## 参与开发
如果有好的想法,或者想实现 [『待完成需求』](#待完成需求)中的部分功能,请邮 [admin@wj2015.com](mailto:admin@wj2015.com),或者提 GitHub Issue,或者加群 [555056599](https://jq.qq.com/?_wv=1027&k=5RcqcwI) 讨论。
如果有意贡献代码,那么在开始之前,请先阅读 [『参与开发』](http://excel.wj2015.com/_book/docs/参与开发.html) 文档。
## 特别感谢
感谢 Layui 社区的小伙伴们的使用及建议,还有交流群中反馈各种问题和积极回复问题的群友们,以及 Github 上提 ISSUE、PR 的小伙伴们~
也非常感谢大方的 Jetbrains 提供的免费 IDE License,很好用很强大,[https://www.jetbrains.com/?from=LAY-EXCEL](https://www.jetbrains.com/?from=LAY-EXCEL)
## 友情链接
[Authtree插件](https://github.com/wangerzi/layui-authtree) 、 [JeffreyWang的个人博客](https://blog.wj2015.com)
## 开源协议
LAY-EXCEL is licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/GitbookIO/gitbook/blob/master/LICENSE) for the full license text.
没有合适的资源?快使用搜索试试~ 我知道了~
layui-excel-master
共165个文件
gif:79个
js:29个
md:16个
需积分: 5 0 下载量 79 浏览量
2023-11-15
14:30:28
上传
评论
收藏 10.7MB 7Z 举报
温馨提示
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is
资源推荐
资源详情
资源评论
收起资源包目录
layui-excel-master (165个子文件)
.babelrc 23B
layui.css 68KB
layer.css 14KB
layui.mobile.css 10KB
laydate.css 7KB
code.css 1KB
iconfont.eot 40KB
ScreenToGif.gif 6.49MB
screenGIF.gif 2.12MB
ScreenToGif-2.gif 1.21MB
ScreenToGif-3.gif 625KB
59.gif 10KB
22.gif 10KB
24.gif 8KB
13.gif 7KB
16.gif 7KB
39.gif 6KB
64.gif 6KB
63.gif 6KB
50.gif 6KB
loading-0.gif 6KB
4.gif 6KB
1.gif 5KB
42.gif 5KB
71.gif 5KB
21.gif 5KB
20.gif 5KB
29.gif 5KB
70.gif 4KB
5.gif 4KB
17.gif 4KB
27.gif 4KB
9.gif 4KB
44.gif 4KB
11.gif 4KB
8.gif 4KB
3.gif 4KB
23.gif 4KB
34.gif 4KB
41.gif 4KB
38.gif 4KB
65.gif 3KB
32.gif 3KB
45.gif 3KB
7.gif 3KB
12.gif 3KB
26.gif 3KB
60.gif 3KB
2.gif 3KB
40.gif 3KB
25.gif 3KB
19.gif 3KB
66.gif 3KB
18.gif 3KB
46.gif 3KB
10.gif 3KB
28.gif 3KB
51.gif 3KB
57.gif 3KB
67.gif 3KB
0.gif 3KB
48.gif 3KB
43.gif 3KB
30.gif 2KB
61.gif 2KB
33.gif 2KB
69.gif 2KB
14.gif 2KB
47.gif 2KB
36.gif 2KB
49.gif 2KB
58.gif 2KB
6.gif 2KB
54.gif 2KB
53.gif 2KB
56.gif 2KB
62.gif 2KB
31.gif 2KB
55.gif 2KB
35.gif 2KB
15.gif 2KB
loading-2.gif 2KB
37.gif 1KB
68.gif 1KB
52.gif 777B
loading-1.gif 701B
.gitignore 38B
index.html 7KB
index.html 7KB
index.html 6KB
index.html 5KB
children.html 2KB
index.html 2KB
index.html 1KB
excel.js 1.05MB
xlsx.js 885KB
cpexcel.js 461KB
jszip.js 308KB
layui.all.js 255KB
jquery.js 95KB
共 165 条
- 1
- 2
资源评论
汶汶
- 粉丝: 1
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 斗音评论区关键词私信.apk
- Linux常用命令大全.pdf
- plantuml======资源
- 基于java开发的密码解锁APP,包含手势密码解锁+指纹密码解锁+源码+项目界面展示(毕业设计&课程设计&项目开发)
- 基于单片机的智能窗帘设计
- 基于STM32F103C8T6+LCD1602+MCP6S28的8通道模拟可编程增益放大器Proteus仿真
- 5G RAN NR TDD单用户峰值吞吐率计算过程.pptx
- 基于Objective-C开发的手势密码解锁和面容解锁(代码简洁高效通俗易懂)+源码+开发文档+源码解析(毕业设计&课程设计)
- LangChain学习之 Question And Answer的操作附带数据文件
- linux常用命令大全.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功