0.2.0 • Published 4 years ago
excel-downloader v0.2.0
download-excel
to make download excel more easily. Support base64 and json 下载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
0.2.0
4 years ago