Skip to content
Advertisement

drag and drop in vue js without component

I want to use html 5 drag and drop in vue js .

I see the w3schools tutorial about drag and drop . It works in a simple html file but doesn’t work in my vue project

My tutorials code and link is : w3schools – drag : https://www.w3schools.com/jsref/event_ondrag.asp and my error says : Uncaught ReferenceError: allowDrop is not defined

I define all methods in method scope in vue js.

Advertisement

Answer

you just need to call the vue event not the html event v-on:drop instead of drop for example

here is the implementation of the example you provided in the link with vue

JavaScript
Advertisement