# vue-excel-xlsx

> Export your data as an XLSX file

Latest version **1.2.2** (published 2022-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-excel-xlsx
pnpm add vue-excel-xlsx
yarn add vue-excel-xlsx
bun add vue-excel-xlsx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2022-01-25 |
| First published | 2019-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 42 |
| Author | Taron Chatoyan |
| Maintainers | t-chatoyan |
| Keywords | vue, excel, xlsx, json, export, json excel, export excel, download excel, excel xlsx, export |

## Links

- npm: https://www.npmjs.com/package/vue-excel-xlsx
- Repository: https://github.com/t-chatoyan/vue-excel-xlsx
- Homepage: https://github.com/t-chatoyan/vue-excel-xlsx#readme
- Issues: https://github.com/t-chatoyan/vue-excel-xlsx/issues
- npm.io page: https://npm.io/package/vue-excel-xlsx

## Dependencies (1)

- [xlsx](https://npm.io/package/xlsx.md) ^0.14.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.2 (latest) — 2022-01-25
- 1.2.0 — 2022-01-25
- 1.0.11 — 2019-08-03
- 1.0.10 — 2019-08-01
- 1.0.9 — 2019-08-01
- 1.0.8 — 2019-08-01
- 1.0.7 — 2019-08-01
- 1.0.6 — 2019-08-01
- 1.0.5 — 2019-08-01
- 1.0.4 — 2019-08-01
- 1.0.3 — 2019-08-01
- 1.0.2 — 2019-08-01
- 1.0.1 — 2019-06-13
- 1.0.0 — 2019-06-12

## README

# vue-excel-xlsx

Convert your data as an XLSX file

## Getting started

``` javascript
    npm install vue-excel-xlsx --save
```

##### OR

``` javascript
    yarn add vue-excel-xlsx
```

#### Import vue-excel-xlsx in your app:

``` javascript
    import VueExcelXlsx from "vue-excel-xlsx";
    import Vue from "vue";

    Vue.use(VueExcelXlsx);
```

#### Add in your template
``` html
    <vue-excel-xlsx
        :data="data"
        :columns="columns"
        :file-name="'filename'"
        :file-type="'xlsx'"
        :sheet-name="'sheetname'"
        >
        Download
    </vue-excel-xlsx>
```

#### Add in your script
``` javascript
        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    |

---
_Source: https://npm.io/package/vue-excel-xlsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
