Why doesn't the '@drop' event work for me in vue? Why doesn't the '@drop' event work for me in vue? vue.js vue.js

Why doesn't the '@drop' event work for me in vue?


In order to make the div a drop target, the div's dragenter and dragover events must be canceled. You can invoke Event.preventDefault() on those events with the .prevent event modifier:

<div @drop="dropLink" @dragenter.prevent @dragover.prevent></div>

If you need to accept/reject drops based on the drag data type, set a handler that conditionally calls Event.preventDefault():

<div @drop="dropLink" @dragenter="checkDrop" @dragover="checkDrop"></div>
export default {  methods: {    checkDrop(e) {      if (/* allowed data type */) {        e.preventDefault()      }    },  }}

demo