vue-slice-file-uploader
v1.1.0
Published
vue slice uploader
Downloads
12
Readme
vue-slice-file-uploader
Table of contents
Installation
npm install --save vue-slice-file-uploader
import
import Vue from 'vue'
import VueSliceFileUploader from 'vue-slice-file-uploader'
Vue.component('vue-slice-file-uploader', VueSliceFileUploader)
Documents
| Property
| Type
| Default
| Description
|
|-----------------------|-----------------------|-----------------------------------|-----------------------------------|
|:name|String|''|name attribute of the file upload button|
|:id|String|''|id attribute of the file upload button|
|:accept|String|''|accept attribute of the file upload button|
|:capture|String|''|capture attribute of the file upload button|
|:disabled|Boolean|false|disabled attribute of the file upload button|
|:action|String|''|url of the slice upload request|
|:unique|Boolean|false|either return MD5 hash or not|
|:auto-upload|Boolean|false|either auto upload after file change event or not|
|:each-size|Number|2|each chunk size (MB)|
|:headers|Object|{}|headers of the slice upload request|
|:data|Object|{}|extra info of the slice upload request|
|:on-change|Function|(file) => {}|change callback of the file upload button|
|:before-upload|Function|(file, chunkList) => true|return false => stop upload, return true => start upload, return a chunkList => format the payload of slice upload request and start upload |
|:request|Function|(file, chunkList) => {}|customize slice upload request, will cover the default action|
|:on-cancel|Function|(file) => {}|cancel callback of slice upload|
|:on-success|Function|(file) => {}|success callback of slice upload|
|:on-error|Function|(file) => {}|error callback of slice upload|