A simple upload component for Vue.js 2.x
npm install vue-simple-upload-component --save-dev
<template>
<div>
<upload-file @changed-files="uploadAction($event)"></upload-file>
</div>
</template>
<script>
import UploadFile from 'vue-simple-upload-component'
export default {
name: "MyComponent",
components: {
UploadFile
}
}
</script>
Properties | Description |
---|---|
message | Default: Choose a file... Required: false It's used to indicate the upload zone. |
dragOverMessage | Default: Drag it here Required: false Used when dragover event is dispatched |
uploadedMessage | Default: empty Required: false Used to show a message when upload a file |
showButton | Default: false Required: false Show send button. |
buttonTitle | Default: Send Required: false Send button title/value |
cancelButton | Default: Cancel Required: false File cancel button |
itemIndex | Default: 0 Required: false Component index for multiples upload components |
isDragDrop | Default: false Required: false Enable/Disable Drag&Drop. |
acceptedFormats | Default: [] Required: false Accepted MIME Types. |
Event | Description |
---|---|
send-file | Called if drag&drop is inactive and user pressed the 'Send' button |
changed-files | When files list's changed, added or removed a file. |
selected-file | When a file is added (REMOVED) |
remove-file | Called when the actual file is removed (REMOVED) |
Added support to multiple files Changed 'add' and 'remove' file methods.