4.0.15 • Published 4 months ago

@vxe-ui/plugin-export-xlsx v4.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@vxe-ui/plugin-export-xlsx

Vxe UI plug-in supports xlsx file export. use exceljs.

Compatibility

It corresponds to vxe-table v4 or vxe-pc-ui v4

Installing

npm install @vxe-ui/plugin-export-xlsx exceljs
// ...
// Use vxe-pc-ui
import { VxeUI } from 'vxe-pc-ui'
// Use vxe-table
// import { VxeUI } from 'vxe-table'
import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
import ExcelJS from 'exceljs'
// ...

// 1:NPM install, inject ExcelJS objects
VxeUI.use(VxeUIPluginExportXLSX, {
  ExcelJS
})

// 2:CDN install, just make sure window.ExcelJS exists
// VxeUI.use(VxeUIPluginExportXLSX)

Table Demo

<template>
  <vxe-button @click="exportEvent">Export.xlsx</vxe-button>

  <vxe-table
    ref="tableRef"
    :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>
</template>

<script>
export default {
  data () {
    return {
      tableData: [
        { id: 100, name: 'test', age: 26, date: '2019-01-01' },
        { id: 101, name: 'test1', age: 30, date: '2019-01-01' },
        { id: 102, name: 'test2', age: 34, date: '2019-01-01' }
      ]
    }
  },
  methods: {
    exportEvent() {
      this.$refs.tableRef.exportData({
        filename: 'export',
        sheetName: 'Sheet1',
        type: 'xlsx'
      })
    }
  }
}
</script>

Contributors

Thank you to everyone who contributed to this project.

vxe-ui-plugins

License

MIT © 2019-present, Xu Liangzhan

3.0.14

4 months ago

4.0.15

4 months ago

3.0.13

4 months ago

4.0.14

4 months ago

4.0.13

5 months ago

3.0.12

5 months ago

4.0.9

6 months ago

3.0.9

6 months ago

3.0.10

6 months ago

3.0.11

6 months ago

3.0.8

6 months ago

4.0.10

6 months ago

4.0.12

6 months ago

4.0.11

6 months ago

3.0.7

7 months ago

4.0.8

7 months ago

3.0.6

8 months ago

3.0.5

8 months ago

4.0.5

8 months ago

4.0.7

8 months ago

4.0.6

8 months ago

3.0.4

9 months ago

4.0.4

9 months ago

3.0.3

9 months ago

3.0.2

9 months ago

4.0.3

9 months ago

3.0.1

10 months ago

3.0.0

10 months ago

4.0.2

12 months ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.0-beta.0

1 year ago