npm.io
0.2.0 • Published 6 years ago

excel-downloader

Licence
—
Version
0.2.0
Deps
7
Size
1.2 MB
Vulns
6
Weekly
0

download-excel

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

demo

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