vue-electron

The vue plugin that attaches electron APIs to the Vue object, making them accessible to all components.
161,317 294
Install
npm install vue-electron
Latest Version:1.0.6
License:ISC
Last Updated:Oct 10, 2019
Links: GitHub  ·  npm
Maintainer: simulatedgreg

vue-electron

The vue plugin that wraps electron APIs to the Vue object.

js-standard-style

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

npm install vue-electron --save

Include using webpack or browserify

main.js

import Vue from 'vue'
import VueElectron from 'vue-electron'

Vue.use(VueElectron)

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...

const electron = require('electron')

export default {
  methods: {
    getName () {
      return electron.remote.app.getName()
    }
  }
}

Now you can...

export default {
  methods: {
    getName () {
      return this.$electron.remote.app.getName()
    }
  }
}

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.

Related Packages

vue-electron-json-storage

A vue plugin that attaches electron-json-storage APIs to the Vue object, making...

3,346 1
vue-plugin-axios

A wrapper for integrating axios to Vuejs

3,521 5
vusion-api

Vusion Node.js API

47,573 2
@sampullman/vue3-fetch-api

Small fetch wrapper for quickly prototyping API clients

1,178 4
@samatech/vue3-eth

Vue3 library for building Dapps in an ES module environment

668 8

Version History

Version Released License
1.0.6 ISC
1.0.5 ISC
1.0.4 ISC
1.0.2 ISC
1.0.1 ISC