npm.io
1.26.8 β€’ Published 2 months ago

@visactor/vtable-export

Licence
MIT
Version
1.26.8
Deps
5
Size
2.0 MB
Vulns
0
Weekly
0
Stars
3.7K

VTable-Export

This package is no longer maintained, please use the TableExportPlugin plugin in @visactor/vtable-plugins

npm Version npm Download license

Usage

Installation

npm package

// npm
npm install @visactor/vtable-export

// yarn
yarn add @visactor/vtable-export

Quick Start

import * as VTable from '@visactor/vtable';
import { downloadCsv, exportVTableToCsv, downloadExcel, exportVTableToExcel } from '@visactor/vtable-export';

const option = {
  header: [
    {
      field: '0',
      caption: 'name'
    },
    {
      field: '1',
      caption: 'age'
    },
    {
      field: '2',
      caption: 'gender'
    },
    {
      field: '3',
      caption: 'hobby'
    }
  ],
  records: new Array(1000).fill(['John', 18, 'male', 'πŸ€'])
};

const tableInstance = new VTable.ListTable(option);

// download csv file
await downloadCsv(exportVTableToCsv(tableInstance), 'export-csv');

// download excel file
await downloadExcel(await exportVTableToExcel(tableInstance), 'export-excel');

More demos and detailed tutorials

Ecosystem

Project Description
AI-generated Components AI-generated table component.

Contribution

If you would like to contribute, please read the Code of Conduct ε’Œ Guide first。

Small streams converge to make great rivers and seas!

License

MIT License