I have the following code:
Vue.js
function dropHandler(event: DragEvent) {
const { files } = event.dataTransfer as HTMLDivElement;
console.log(files);
}
HTML
div.text-center(
@dragenter.stop.prevent=""
@dragover.stop.prevent=""
@drop.stop.prevent="dropHandler"
@click="$refs.input.click()"
)
Even I add event: DragEvent and as HTMLDivElement, I still have an error: 'Property 'files' does not exist on type 'HTMLDivElement''.
I understand this error and why this is happening, but I can't find a workaround to do this with typescript, any ideas?