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

1.0.11 • Public • Published

vxe-table-plugin-export-xlsx

gitee star npm version npm downloads gzip size: JS npm license

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

Installing

npm install xe-utils vxe-table vxe-table-plugin-export-xlsx xlsx
import Vue from 'vue'
import VXETable from 'vxe-table'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
 
Vue.use(VXETable)
VXETable.use(VXETablePluginExportXLSX)

Demo

<vxe-toolbar>
  <template v-slot:buttons>
    <vxe-button @click="exportEvent">导出.xlsx</vxe-button>
  </template>
</vxe-toolbar>
 
<vxe-table
  border
  ref="xTable"
  height="600"
  :data="tableData">
  <vxe-table-column type="index" width="60"></vxe-table-column>
  <vxe-table-column prop="name" label="Name"></vxe-table-column>
  <vxe-table-column prop="age" label="Age"></vxe-table-column>
  <vxe-table-column prop="date" label="Date"></vxe-table-column>
</vxe-table>
export default {
  data () {
    return {
      tableData: [
        {
          id: 100,
          name: 'test',
          age: 26,
          date: null
        }
      ]
    }
  },
  methods: {
    exportEvent() {
      this.$refs.exportData({
        filename: 'export',
        sheetName: 'Sheet1',
        type: 'xlsx'
      })
    }
  }
}

License

MIT License, 2019-present, Xu Liangzhan

Package Sidebar

Install

npm i vxe-table-plugin-export

Weekly Downloads

8

Version

1.0.11

License

MIT

Unpacked Size

52.5 kB

Total Files

9

Last publish

Collaborators

  • x-extends