Skip to content
Latestv1.0.60

Table - Export Data

Through the built-in export feature, you can export table data to CSV, JSON, TXT, XML, HTML, XLSX and other formats, supporting custom columns, formatted content, excluded columns and other advanced configurations.

Export Data

The most basic export method, export table data as a CSV file through the component instance method exportData().

Export Data

Export TXT Format

TXT format uses Tab-separated columns, which can be directly pasted into Excel.

Export TXT

Export XML Format

Export standard XML structure, suitable for data exchange with other systems.

Export XML

Export HTML Format

Export styled HTML table file, viewable directly in a browser.

Export HTML

Export CSV Format

CSV export supports Include Index column, automatically adding BOM header to ensure correct Chinese display in Excel.

Export CSV

Export JSON Format

JSON format export that preserves original data types.

Export JSON

Export Excel Format

Export as .xlsx format Excel file, supporting Auto calculate column width, custom Sheet name and other advanced features.

Tip: Excel export relies on the xlsx library. Exported files can be opened directly with Microsoft Excel, WPS and other software.

Export Excel

Custom Data

Specify export data through the data parameter to implement filtered export.

Custom Data

Formatted Export Content

Customize cell export values through the formatCell callback function, such as adding currency symbols, status icons, etc.

Formatted Export

Advanced Export

Configure export format, filename, whether to include Index and header, and get export result through afterExport callback.

Advanced Export

Exclude Columns

Specify columns not to be exported through excludeColumns.

Exclude Columns

Specify Columns

Specify which columns to export through columns.

Specify Columns

Custom Column Titles

Use columnTitles to customize column titles when exporting, e.g., export English headers.

Custom Column Titles

Custom Export Type

Select export format through a dropdown menu.

Custom Export Type

Server-Side Export

For very large datasets or scenarios requiring XLSX/PDF format generation, server-side export is recommended.

Server-Side Export

Custom Export Mode

Setting mode: 'string' returns the export content string without triggering download, suitable for copying to clipboard or further processing.

Custom Export Mode

API

exportData(config?) Method

PropertyDescriptionTypeDefault
typeExport format'csv' | 'json' | 'txt' | 'xml' | 'html' | 'xlsx''csv'
filenameFilename (without extension)string'export'
includeHeaderWhether to include Headerbooleantrue
showIndexWhether to include Index columnbooleanfalse
indexTitleIndex column titlestring'No.'
columnsSpecify export columns (prop array)string[]All visible columns
excludeColumnsExclude columns (prop array)string[]
visibleOnlyWhether to export only visible columnsbooleantrue
dataCustom Export DataRecord<string, unknown>[]Current table data
columnTitlesCustom Column Titles mappingRecord<string, string>
formatCellFormat cell content(value, column, row) => string
separatorCSV separatorstring','
bomWhether to add BOM headerbooleantrue
modeExport mode'download' | 'string''download'
beforeExportBefore export callback() => boolean
afterExportAfter export callback(type) => void
sheetNameSheet name (XLSX only)string'Sheet1'
columnWidthsColumn width config (XLSX only), e.g. { name: 15, address: 30 }Record<string, number>
defaultColWidthDefault column width (XLSX only)number12
autoWidthWhether to auto-adjust column width (XLSX only)booleantrue

Format Descriptions

FormatExtensionMIMEFeatures
CSV.csvtext/csvUniversal format, Excel can open directly, auto BOM
JSON.jsonapplication/jsonPreserves original data types, suitable for inter-program exchange
TXT.txttext/plainTab-separated, can be pasted directly into Excel
XML.xmlapplication/xmlStandard XML structure, suitable for system integration
HTML.htmltext/htmlStyled table, viewable directly in browser
XLSX.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel format, supports auto column width, multiple sheets

Released under the MIT License.