Simple File upload component for Vue.js
npm install vue-simple-upload


An simple file upload component for vue.js.
npm install vue-simple-upload
jsimport FileUpload from 'vue-simple-upload/dist/FileUpload'
export default {
...
components: {
'fileupload': FileUpload
},
...
}
`
After that, you can use it in your templates:`html
`$3
`js
var Vue = require('vue')
var FileUpload = require('vue-simple-upload')var YourComponent = Vue.extend({
...
components: {
'fileupload': FileUpload.FileUpload
},
...
})
`$3
`html
`
Usage
`vue
`Props
- target (String):
Target endpoint to upload the file
- action (String):
Target action ( POST or PUT )
Events
You can access the file upload events using v-on methods.
- File Upload start event:
You can access the start event using v-on:start="startUpload"
`jsmethods() {
startUpload(e) {
// start event
}
}
`- File Upload finish event:
You can access the start event using v-on:finish="finishUpload"
`jsmethods() {
finishUpload(e) {
// finish event
}
}
`- File Upload progress event:
You can access the file upload progress using v-on:progress="progress"
`jsmethods() {
progress(e) {
// listen to file upload progress
}
}
``- Multi File Upload
Released under the MIT License.