The export util of VTable
npm install @qinliuliu/vtable-exportThis package is no longer maintained, please use the TableExportPlugin plugin in @visactor/vtable-plugins



``bash
// npm
npm install @visactor/vtable-export
// yarn
yarn add @visactor/vtable-export
`
`jsx
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
| Project | Description |
| -------------------------------------------------------- | ----------------------------- |
| AI-generated Components | AI-generated table component. |
If you would like to contribute, please read the Code of Conduct 和 Guide first。
Small streams converge to make great rivers and seas!