MyGit

x-extends/vxe-table-plugin-export-xlsx

Fork: 18 Star: 41 (更新于 2024-10-18 21:06:02)

license: MIT

Language: TypeScript .

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

最后发布版本: 4.0.5 ( 2024-07-08 17:59:50)

GitHub网址

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

最近版本更新:(数据更新于 2024-09-12 10:45:31)

2024-07-08 17:59:50 4.0.5

2024-07-08 17:59:22 3.3.2

2024-06-25 14:22:30 4.0.4

2021-04-12 15:31:25 3.0.2

2021-03-23 23:24:38 2.2.1

2021-03-16 17:56:14 3.0.1

2021-03-16 09:51:33 3.0.0

2021-03-16 09:48:27 2.2.0

2021-03-02 19:52:35 2.1.2

2021-01-13 13:54:18 2.1.1

x-extends/vxe-table-plugin-export-xlsx同语言 TypeScript最近更新仓库

2024-11-05 17:55:23 langgenius/dify

2024-11-05 17:35:52 siyuan-note/siyuan

2024-11-05 16:59:32 laurent22/joplin

2024-11-05 12:39:27 lobehub/lobe-chat

2024-11-05 11:52:31 RSSNext/Follow

2024-11-05 07:18:03 microsoft/genaiscript