An open API service indexing awesome lists of open source software.

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 格式

Awesome Lists containing this project

README

          

# vxe-table-plugin-export-xlsx

[![gitee star](https://gitee.com/x-extends/vxe-table-plugin-export-xlsx/badge/star.svg?theme=dark)](https://gitee.com/x-extends/vxe-table-plugin-export-xlsx/stargazers)
[![npm version](https://img.shields.io/npm/v/vxe-table-plugin-export-xlsx.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table-plugin-export-xlsx)
[![npm downloads](https://img.shields.io/npm/dm/vxe-table-plugin-export-xlsx.svg?style=flat-square)](http://npm-stat.com/charts.html?package=vxe-table-plugin-export-xlsx)
[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](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.

[![vxe-table-plugin-export-xlsx](https://contrib.rocks/image?repo=x-extends/vxe-table-plugin-export-xlsx)](https://github.com/x-extends/vxe-table-plugin-export-xlsx/graphs/contributors)

## License

[MIT](LICENSE) © 2019-present, Xu Liangzhan