1π
On mounted just add this code and it works.
mounted(){
dropContainer.ondragover = dropContainer.ondragenter = function(evt) {
evt.preventDefault();
};
dropContainer.ondrop = function(evt) {
// pretty simple -- but not for IE :(
this.loaddropfile(evt);
evt.preventDefault();
};
}
and add the id to a div tag.
<div id="dropContainer" class="image-preview dropzone d-flex justify-content-center align-items-center" @click="openinput">
Working fiddle β https://jsfiddle.net/29z18a5g/
π€Pratik Patel
- [Vuejs]-CSS styling procedure for vue component
- [Vuejs]-Vuetify β How to change v-img source with setTimeout function
Source:stackexchange.com