API
Props
| name | type | default | description | required version |
| title | string | 图片上传 | component title | -- |
| files | array | [] | initial file data source, through event on-fileList-change bind v-model | -- |
| limit | number string | 5 | limit upload image count | -- |
| limitPrompt | function | (limit) => `不能上传超过${limit}张图片` | prompt for limit alert | -- |
| capture | number string | false | whether only invoke camera | -- |
| enableCompress | boolean | true | whether enable compress | -- |
| maxWidth | string number | 1024 | image compress max width | -- |
| quality | string number | 0.92 | image compress rate | -- |
| url | string | upload server url | -- | |
| headers | object | {} | custom upload request headers | -- |
| withCredentials | boolean | setting as true, can support CORS set cookie | -- | |
| params | object | custom formData params | -- | |
| name | string | file | upload formData key, default as file | -- |
| autoUpload | boolean | true | whether auto upload | -- |
| multiple | string boolean | whether support multiple select image, false will not support | -- | |
| readonly | boolean | false | field readonly (hide add and delete button) | -- |
Events
| name | params | description | required version |
| @on-change | (FileItem, FileList) | emits when file change | -- |
| @on-cancel | -- | emits when cancel select image | -- |
| @on-success | (result, fileItem) | emits when file upload success | -- |
| @on-error | (xhr) | emits when file upload failed | -- |
| @on-delete | (cb) | emits when delete file, the first params is a callback which can hide previewer | -- |
| @before-upload | -- | emits before invoke xhr request | -- |
| @after-upload | (action) | emits after xhr request finished | -- |