Skip to content

Commit

Permalink
feat(QrcodeDropZone): dragover event
Browse files Browse the repository at this point in the history
  • Loading branch information
gruhn committed Feb 11, 2019
1 parent eb6583e commit 4ec0a25
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/QrcodeDropZone.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template lang="html">
<div
@drop.prevent.stop="onDrop"
@dragover.prevent.stop
@dragenter.prevent.stop
@dragleave.prevent.stop>
@dragenter.prevent.stop="onDragOver(true)"
@dragleave.prevent.stop="onDragOver(false)"
@dragover.prevent.stop>
<slot></slot>
</div>
</template>
Expand All @@ -18,7 +18,13 @@ export default {
mixins: [ CommonAPI ],
methods: {
onDragOver (isDraggingOver) {
this.$emit('dragover', isDraggingOver)
},
onDrop ({ dataTransfer }) {
this.onDragOver(false)
const droppedFiles = [...dataTransfer.files]
const droppedUrl = dataTransfer.getData('text')
Expand Down

0 comments on commit 4ec0a25

Please sign in to comment.