Registry / web-framework / vue-electron

vue-electron

JSON →
library1.0.6jsnpmunverified

vue-electron (v1.0.6, last updated 2017) is a Vue.js plugin that attaches all Electron APIs to the Vue prototype, making them accessible via `this.$electron` in any component. It eliminates the need to import `electron` in every file, simplifying integration in electron-vue boilerplate projects. The plugin is a thin wrapper that installs via `Vue.use()`. It is stable but no longer actively maintained; users are encouraged to migrate to modern approaches like `window.require('electron')` or using the `@electron/remote` package directly. Release cadence is low, with no recent updates.

npm install vue-electron
INSTALL
IMPORT
SIG · VUE-ELECTRON
V
vue-electron
web-frameworkjavascriptv1.0.6
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VueElectron
✓ import VueElectron from 'vue-electron'
✗ const VueElectron = require('vue-electron')
Package does not export a CommonJS module; works only in webpack/browserify environments. Since v1.0.0, default import is required.
$electron
✓ this.$electron in components
✗ this.$electron.remote.require('electron')
Access via `this.$electron` in any Vue component after installing plugin. No need to import electron separately.
Vue.use
✓ Vue.use(VueElectron)
✗ new VueElectron()
Plugin must be installed with Vue.use(), not instantiated directly.

This shows how to install vue-electron, then use this.$electron in a component to call Shell.openExternal.

// main.js import Vue from 'vue' import VueElectron from 'vue-electron' Vue.use(VueElectron) new Vue({ el: '#app', render: h => h(App) }) // MyComponent.vue export default { methods: { openExternalLink(url) { // Access electron APIs via this.$electron this.$electron.shell.openExternal(url) } } }
Debug
Known issues
deprecatedPackage is no longer maintained since 2017. Use in new projects is discouraged.
fix
Migrate to using `window.require('electron')` or install `@electron/remote` and use `remote.require('electron')`.
affects: *
gotchaDoes not work with Electron >= 10 because remote module is removed. The plugin relies on `remote` which requires explicit package `@electron/remote`.
fix
Install @electron/remote and enable remote module via main process; then use window.require('electron') instead.
affects: >=10.0.0
gotchaNot compatible with Vue 3 (Vue.createApp vs Vue.use pattern changed).
fix
Use Vue 2 or manually assign electron APIs using Vue.prototype.$electron = require('electron').
affects: >=3.0.0
breakingPlugin does not support Electron's sandbox mode or contextIsolation: true. Accessing this.$electron may fail.
fix
Disable contextIsolation in BrowserWindow options or use preload script to expose electron APIs safely.
affects: >=5.0.0
Errors
Common errors & fixes
TypeError: Cannot read property 'electron' of undefined
Accessing this.$electron before Vue plugin is installed.
fix
Ensure Vue.use(VueElectron) is called before creating the root Vue instance.
electron is not defined
Trying to use vue-electron outside of Electron main/renderer process (e.g., in a browser).
fix
Only use vue-electron in Electron renderer process. Check if window.require is available.
Uncaught Error: Cannot find module 'vue-electron'
Missing dependency or incorrect import path.
fix
Run 'npm install vue-electron' and ensure import path is correct: 'vue-electron' not 'vue-electron/dist/...'.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
vuerequiredpeer dependency - plugin requires Vue to be installed
Agent activity
15 hits · last 30 days
node
12
Anthropic
1
OpenAI (training)
1
Resources
vue-electron — npm install vue-electron · libregistry