🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vue-electron

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-electron

The vue plugin that attaches electron APIs to the Vue object, making them accessible to all components.

1.0.6
latest
Source
npm
Version published
Weekly downloads
1.2K
-38.16%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

vue

FAQs

Package last updated on 12 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts