Skip to content

cezardasilva/vue-simple-upload-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Upload Component npm npm npm GitHub stars

A simple upload component for Vue.js 2.x

Instalation

npm install vue-simple-upload-component --save-dev

Usage example

<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>

Props

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.

Events

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)

Change Log

v1.0.0

Added support to multiple files Changed 'add' and 'remove' file methods.