vxe-table-plugin-export-xlsx
TypeScript icon, indicating that this package has built-in type declarations

4.0.7 • Public • Published

vxe-table-plugin-export-xlsx

gitee star npm version npm downloads npm license

基于 vxe-table 的表格插件,支持导出 xlsx 格式,基于 exceljs 实现

Compatibility

对应 vxe-table v4 版本

Installing

npm install vxe-table vxe-table-plugin-export-xlsx exceljs
// ...
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

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

License

MIT © 2019-present, Xu Liangzhan

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.25next
3.3.10v3-legacy
4.0.7675latest
3.3.7328legacy

Version History

VersionDownloads (Last 7 Days)Published
3.3.7328
4.0.7675
3.3.60
3.3.50
3.3.42
4.0.614
3.3.33
4.0.522
3.3.23
3.3.10
4.0.434
4.0.30
4.0.25
3.3.013
4.0.188
4.0.01
2.3.154
3.1.020
2.3.00
3.0.84
2.2.65
3.0.70
2.2.50
3.0.60
2.2.40
2.2.30
3.0.53
3.0.4138
2.2.2114
3.0.38
3.0.20
2.2.121
3.0.10
2.2.00
3.0.01
3.0.0-beta.50
3.0.0-beta.40
3.0.0-beta.30
3.0.0-beta.20
3.0.0-beta.10
3.0.0-beta.00
3.0.0-alpha.20
2.1.22
2.1.12
3.0.0-alpha.10
2.1.00
2.1.0-beta.10
2.1.0-beta.00
2.1.0-beta0
2.0.99
2.0.80
2.0.70
2.0.60
3.0.0-alpha.00
2.0.50
2.0.40
2.0.30
2.0.24
2.0.10
2.0.015
2.0.0-beta.00
1.6.46
1.6.30
1.6.20
1.6.17
1.6.09
1.5.01
1.3.130
1.3.120
1.3.110
1.3.100
1.3.90
1.3.83
1.3.70
1.3.60
1.3.50
1.3.40
1.3.30
1.3.10
1.3.00
1.3.0-alpha.00
1.2.20
1.2.12
1.2.00
1.1.01
1.0.0-alpha.40
1.0.0-alpha.30
1.0.0-alpha.20
1.0.0-alpha.10

Package Sidebar

Install

npm i vxe-table-plugin-export-xlsx

Weekly Downloads

1,617

Version

4.0.7

License

MIT

Unpacked Size

64.9 kB

Total Files

8

Last publish

Collaborators

  • x-extends