This plugin will attach electron APIs to the Vue object itself, so accessing all APIs is dead simple. All official documentation from electron can be used and accessed from this.$electron.
Now you might be thinking, "Is it really that annoying to simply require electron to access it?" Probably not, but it can get cumbersome to have to include it in every component file that needs it. In the end, attaching electron directly to Vue just makes sense.
SimulatedGREG/vue-electron
vue-electron
Need a full boilerplate for creating electron apps built with vue? Make sure to check out electron-vue.
https://github.com/SimulatedGREG/electron-vue
Installing
Install using NPM
Include using webpack or browserify
main.js
Using the plugin
This plugin will attach electron APIs to the Vue object itself, so accessing all APIs is dead simple. All official documentation from electron can be used and accessed from
this.$electron
.So instead of...
Now you can...
Now you might be thinking, "Is it really that annoying to simply require electron to access it?" Probably not, but it can get cumbersome to have to include it in every component file that needs it. In the end, attaching electron directly to Vue just makes sense.