Closed xiaohulu closed 3 years ago
Fixed by Using electron API in renderer.
Hey. I have the same question now. How to access to electron from vue template now right way? Fix description already removed ;(
@ErriourRU. Docs. In preload
you should create global function or something. And just use it in renderer
from global scope
I add below code to
renderer/app.vue
then
npm run watch
report errorsindex.js:4 Uncaught ReferenceError: __dirname is not defined
npm run compile
success, but load failed and report errorsindex.html:1 Uncaught TypeError: Failed to resolve module specifier "electron". Relative references must start with either "/", "./", or "../".