Q. Eude
Q. Eude

Reputation: 881

Drag and drop file electron/vue.js

I am trying to make an app with electron and vue.js, in this one I want to make a DropZone for file and just get the path of this file. My problem is that electron is opening my file like a file viewer. How can I disable it with vue.js ?

Upvotes: 0

Views: 1477

Answers (1)

Hans Koch
Hans Koch

Reputation: 4481

The will-navigate event is designed to catch/parse dropped files in electron. So it is not a vue.js specific issue.

This snippet will prevent the render process from loading the image as content.

mainWindow.webContents.on('will-navigate', (event) => event.preventDefault());

Upvotes: 5

Related Questions