vue-excel-xlsx
Export your data as an XLSX file
127,925
42
| Install | |
|---|---|
npm install vue-excel-xlsx |
|
| Latest Version: | 1.2.2 |
| License: | MIT |
| Last Updated: | Apr 4, 2024 |
| Links: | GitHub · npm |
Maintainer: t-chatoyan
vue-excel-xlsx
Convert your data as an XLSX file
Getting started
npm install vue-excel-xlsx --save
OR
yarn add vue-excel-xlsx
Import vue-excel-xlsx in your app:
import VueExcelXlsx from "vue-excel-xlsx";
import Vue from "vue";
Vue.use(VueExcelXlsx);
Add in your template
<vue-excel-xlsx
:data="data"
:columns="columns"
:file-name="'filename'"
:file-type="'xlsx'"
:sheet-name="'sheetname'"
>
Download
</vue-excel-xlsx>
Add in your script
data() {
return {
columns : [
{
label: "Product",
field: "product",
},
{
label: "Price",
field: "price",
dataFormat: this.priceFormat
},
{
label: "Quantity",
field: "quantity",
},
{
label: "Country",
field: "address.country",
},
{
label: "City",
field: "address.city",
}
],
data : [
{
product: "Beverage",
price: 10,
quantity: 2,
address: {
country: 'Armenia',
city: 'Yerevan',
}
},
{
product: "Snack",
price: 12,
quantity: 6,
address: {
country: 'Armenia',
city: 'Yerevan',
}
},
{
product: "Beverage",
price: 10,
quantity: 5,
address: {
country: 'Armenia',
city: 'Yerevan',
}
},
{
product: "Snack",
price: 12,
quantity: 3,
address: {
country: 'Armenia',
city: 'Yerevan',
}
}
],
}
},
methods: {
priceFormat(value){
return '$ ' + value;
}
}
Props
| Name | Type | Description | Default Value |
|---|---|---|---|
| columns | Array | Columns configuration | [] |
| data | Array | Rows data | [] |
| fileName | String | The name of excel file | excel |
| sheetName | String | The SheetName of excel file | SheetName |
| fileType | String | The Type of excel file. (xlsx, xls) | xlsx |
Related Packages
export-json-excel
Componente de vuejs para exportar json a excel con opciónes personalizadas.
2,933
1
Version History
| Version | Released | License |
|---|---|---|
| 1.2.2 | MIT | |
| 1.2.0 | MIT | |
| 1.0.11 | MIT | |
| 1.0.10 | MIT | |
| 1.0.9 | MIT | |
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT |