# vxe-table-plugin-export-xlsx

> 基于 vxe-table 表格的扩展插件，支持导出 xlsx 格式

Latest version **4.0.7** (published 2024-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install vxe-table-plugin-export-xlsx
pnpm add vxe-table-plugin-export-xlsx
yarn add vxe-table-plugin-export-xlsx
bun add vxe-table-plugin-export-xlsx
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.7 |
| Published | 2024-10-17 |
| First published | 2019-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 63.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Xu Liangzhan |
| Maintainers | x-extends |
| Keywords | vxe-table-plugin-export-xlsx |

## Links

- npm: https://www.npmjs.com/package/vxe-table-plugin-export-xlsx
- Repository: https://github.com/x-extends/vxe-table-plugin-export-xlsx
- Homepage: https://github.com/x-extends/vxe-table-plugin-export-xlsx#readme
- Issues: https://github.com/x-extends/vxe-table-plugin-export-xlsx/issues
- npm.io page: https://npm.io/package/vxe-table-plugin-export-xlsx

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 4.0.7 (latest) — 2024-10-17
- 3.3.7 (legacy) — 2024-10-26
- 3.3.1 (v3-legacy) — 2024-06-24
- 4.0.2 (next) — 2024-05-27
- 3.3.6 — 2024-10-17
- 3.3.5 — 2024-10-11
- 3.3.4 — 2024-09-28
- 4.0.6 — 2024-09-28
- 3.3.3 — 2024-09-11
- 4.0.5 — 2024-07-08
- 3.3.2 — 2024-07-08
- 4.0.4 — 2024-06-18
- 4.0.3 — 2024-06-17
- 3.3.0 — 2024-01-31
- 4.0.1 — 2024-01-21
- … 74 more at https://npm.io/package/vxe-table-plugin-export-xlsx/versions

## 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
<vxe-toolbar>
  <template v-slot:buttons>
    <vxe-button @click="exportEvent">导出.xlsx</vxe-button>
  </template>
</vxe-toolbar>

<vxe-table
  ref="xTable"
  height="600"
  :data="tableData">
  <vxe-column type="seq" width="60"></vxe-column>
  <vxe-column field="name" title="Name"></vxe-column>
  <vxe-column field="age" title="Age"></vxe-column>
  <vxe-column field="date" title="Date"></vxe-column>
</vxe-table>
```

```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

---
_Source: https://npm.io/package/vxe-table-plugin-export-xlsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
