https://github.com/x-extends/vxe-table-plugin-export-xlsx
🔨 基于 vxe-table 的表格插件,支持导出 xlsx 格式
https://github.com/x-extends/vxe-table-plugin-export-xlsx
Last synced: 10 months ago
JSON representation
🔨 基于 vxe-table 的表格插件,支持导出 xlsx 格式
- Host: GitHub
- URL: https://github.com/x-extends/vxe-table-plugin-export-xlsx
- Owner: x-extends
- License: mit
- Created: 2019-11-04T13:11:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-03T13:23:27.000Z (over 1 year ago)
- Last Synced: 2025-03-27T17:02:48.896Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 333 KB
- Stars: 42
- Watchers: 2
- Forks: 18
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vxe-table-plugin-export-xlsx
[](https://gitee.com/x-extends/vxe-table-plugin-export-xlsx/stargazers)
[](https://www.npmjs.com/package/vxe-table-plugin-export-xlsx)
[](http://npm-stat.com/charts.html?package=vxe-table-plugin-export-xlsx)
[](LICENSE)
基于 [vxe-table](https://www.npmjs.com/package/vxe-table) 的表格插件,支持导出 xlsx 格式,基于 [exceljs](https://github.com/exceljs/exceljs) 实现
## Compatibility
对应 vxe-table v4 版本
## Installing
```shell
npm install vxe-table vxe-table-plugin-export-xlsx exceljs
```
```javascript
// ...
import { VxeUI } from 'vxe-table'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import ExcelJS from 'exceljs'
// ...
// 方式1:NPM 安装,注入 ExcelJS 对象
VxeUI.use(VXETablePluginExportXLSX, {
ExcelJS
})
// 方式2:CDN 安装,只要确保 window.ExcelJS 存在即可
// VxeUI.use(VXETablePluginExportXLSX)
```
## Demo
```html
导出.xlsx
```
```javascript
export default {
data () {
return {
tableData: [
{ id: 100, name: 'test', age: 26, date: null },
{ id: 101, name: 'test1', age: 30, date: null },
{ id: 102, name: 'test2', age: 34, date: null }
]
}
},
methods: {
exportEvent() {
this.$refs.xTable.exportData({
filename: 'export',
sheetName: 'Sheet1',
type: 'xlsx'
})
}
}
}
```
## Contributors
Thank you to everyone who contributed to this project.
[](https://github.com/x-extends/vxe-table-plugin-export-xlsx/graphs/contributors)
## License
[MIT](LICENSE) © 2019-present, Xu Liangzhan