Skip to content

Instantly share code, notes, and snippets.

@scottweinert
Created July 19, 2019 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottweinert/73a87dcb3f6ba63950bf0adcf52edcb8 to your computer and use it in GitHub Desktop.
Save scottweinert/73a87dcb3f6ba63950bf0adcf52edcb8 to your computer and use it in GitHub Desktop.
<template>
<div>
<VueDropzone
id="dropzone"
v-on:vdropzone-sending="sendingEvent"
:awss3="awss3"
v-on:vdropzone-s3-upload-error="s3UploadError"
v-on:vdropzone-s3-upload-success="s3UploadSuccess"
:options="dropzoneOptions"
/>
</div>
</template>
<script>
import vue2Dropzone from 'vue2-dropzone'
import 'vue2-dropzone/dist/vue2Dropzone.min.css'
export default {
name: 'MyVue',
components: {
VueDropzone: vue2Dropzone
},
data() {
return {
dropzoneOptions: {
url: 'https://httpbin.org/post',
thumbnailWidth: 200,
addRemoveLinks: true
},
awss3: {
signingURL: 'http://localhost:3001/backoffice/connector/upload',
headers: {},
params: {}
}
}
},
methods: {
sendingEvent(event) {
console.log(sending, event)
},
s3UploadError(errorMessage) {
console.log(errorMessage)
},
s3UploadSuccess(s3ObjectLocation) {
console.log(s3ObjectLocation)
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment