0.2.0 • Published 4 years ago

excel-downloader v0.2.0

Weekly downloads
4
License
-
Repository
-
Last release
4 years ago

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

paramtypedefaultdescription
modeString'json''json' or 'base64'
getDataFunctionnulla function which get data and return a promise
handleErrorFunctionnulla 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