[Vuejs]-How to use the electron functions inside of a Vue component

0๐Ÿ‘

โœ…

I eventually solved this by adding this to my vue.config.js

electronBuilder: {
      preload: 'src/preload.js'
}

Then in my browser window I could load a preloader like normal.

Next in my preload i added this

import { ipcRenderer } from 'electron'
window.ipcRenderer = ipcRenderer

Now I can use window.ipcRenderer in the renderer!

Leave a comment