# excel-downloader

> > to make download excel more easily. Support base64 and json 下载Excel组件

Latest version **0.2.0** (published 2020-03-13) · 0 weekly downloads

## Install

```sh
npm install excel-downloader
pnpm add excel-downloader
yarn add excel-downloader
bun add excel-downloader
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-03-13 |
| First published | 2020-03-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | candy8ullet |

## Links

- npm: https://www.npmjs.com/package/excel-downloader
- npm.io page: https://npm.io/package/excel-downloader

## Dependencies (7)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [vuex](https://npm.io/package/vuex.md) ^3.0.1
- [xlsx](https://npm.io/package/xlsx.md) ^0.15.2
- [core-js](https://npm.io/package/core-js.md) ^3.3.2
- [element-ui](https://npm.io/package/element-ui.md) ^2.12.0
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.2
- [vue-router](https://npm.io/package/vue-router.md) ^3.1.3

## Recent versions

- 0.2.0 (latest) — 2020-03-13

## README

# download-excel

> to make download excel more easily. Support base64 and json 下载Excel组件

[demo](https://sishenhei7.github.io/download-excel/)

## Getting Started

### install

To begin with, just install download-excel:

```
npm i excel-downloader -s
```

Then，register it in ```main.js```:

```
Vue.use(DownloadExcel)
```

### params

| param    | type   |  default  |  description |
| :----: | :-----:  | :----: |  :---: |
| mode | String | 'json' | 'json' or 'base64' |
| getData | Function | null | a function which get data and return a promise |
| handleError | Function | null | a function which handle error |

### examples

You can use DownloadExcel as a vue component anywhere like this:

```
<download-excel
    :mode="mode"
    :get-data="() => getDownloadData()"
    :handle-error="err =>handleDownloadError(err)"
    @loading="val => isLoading = val"
>
    <el-button
        class="btn-icon"
        :icon="isLoading ? 'el-icon-loading' : 'el-icon-download'"
    ></el-button>
</download-excel>
```

For more usage, please check [demo-source-code](https://github.com/sishenhei7/download-excel/tree/master/demo)

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