Super simple File upload component with Vue.js
A super simple unstyled file upload component in Vue.js
- Vue.js (tested with 2.6.11).
Installation
npm install --save m24-vue-upload-file
Example
el: '#app' data: upload: acceptTypes: 'image/*' multiple: false files: components: FileUpload methods: { thisfiles = fileArray } { thisfiles = fileArray } ... // Example of a file submit { const formData = for var i = 0; i < thisfileslength; i++ const file = thisfilesi formData axios }
Props
Name | Type | Default | Required | Description |
---|---|---|---|---|
acceptTypes | String | '' | false | HTML input accept types |
multiple | Boolean | 0 | false | Should the upload accept one or multiple files |
Events
Name | Returns | Description |
---|---|---|
files-uploaded | array of files | Returns an array with files added |
file-removed | array of files | Returns an array of the remaining files |
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.