el-table-export2
v1.0.8
Published
CSV/Text/JSON/XLS data exporter for ElementPlus el-table
Maintainers
Readme
el-table-export2
Component to export data of ElementsPlus el-table into csv/json/text/html.
Fork of tuanzisama/el-table-export which has been archived and doesn't work anymore.
Installation
npm install el-table-export2 --saveor
yarn add el-table-export2Arguments
| Name | Desc | Type | Optional | Default | | ------ | ------ | ------ | ------ | ------ | | fileName | File Name | String | — | export | | type | Export Type | String | text / json / csv / xls | csv | | withBOM | Add BOM(byte order mark) meta to CSV file. BOM is expected by Excel when reading UTF8 CSV file. | Boolean | — | false | | useFormatter | Whether to use the formatter attribute provided by ElementPlus. | Boolean | — | true | | delimiter | Available when the export format is CSV file | String | — | , |
DEMO
See the demo in example/src/App.vue;
import elTableExport from "el-table-export2";
elTableExport(this.$refs.elTable, {
fileName: "export-demo",
type: "csv",
withBOM: false,
}).then((result) => {
console.info("successfully");
}).catch((err) => {
console.info("Error: " , err);
});
