Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simulatedgreg/vue-electron
The vue plugin that attaches electron APIs to the Vue object, making them accessible to all components.
https://github.com/simulatedgreg/vue-electron
electron electron-vue plugin vue
Last synced: about 13 hours ago
JSON representation
The vue plugin that attaches electron APIs to the Vue object, making them accessible to all components.
- Host: GitHub
- URL: https://github.com/simulatedgreg/vue-electron
- Owner: SimulatedGREG
- License: isc
- Created: 2016-06-01T19:04:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T00:27:07.000Z (about 5 years ago)
- Last Synced: 2024-04-23T23:54:45.784Z (7 months ago)
- Topics: electron, electron-vue, plugin, vue
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 300
- Watchers: 9
- Forks: 32
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# vue-electron
> The vue plugin that wraps [electron](https://github.com/electron/electron) APIs to the Vue object.[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
### Need a full boilerplate for creating electron apps built with vue? Make sure to check out electron-vue.
[https://github.com/SimulatedGREG/electron-vue](https://github.com/SimulatedGREG/electron-vue)## Installing
Install using NPM
```sh
npm install vue-electron --save
```Include using webpack or browserify
**main.js**
```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...
```js
const electron = require('electron')export default {
methods: {
getName () {
return electron.remote.app.getName()
}
}
}
```Now you can...
```js
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.