An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
Found an issue or bug with electron-vue? Tell me all about it!
Questions regarding how to use electron or vue are likely to be closed as they are not direct issues with this boilerplate. Please seek solutions from official documentation or their respective communities.
Found an issue or bug with electron-vue? Tell me all about it!
Questions regarding how to use
electron
orvue
are likely to be closed as they are not direct issues with this boilerplate. Please seek solutions from official documentation or their respective communities.Describe the issue / bug.
# main/index,js 代码如下 import { app, BrowserWindow, ipcMain } from 'electron'
/**
__static
path to static files in productionlet mainWindow const winURL = process.env.NODE_ENV === 'development' ?
http://localhost:9080
:file://${__dirname}/index.html
function createWindow() { /**
Initial window options */ mainWindow = new BrowserWindow({ height: 563, useContentSize: true, width: 1000, webPreferences: { webSecurity: false, // 是否禁用浏览器的跨域安全特性 nodeIntegration: true // 是否完整支持node } })
mainWindow.loadURL(winURL)
mainWindow.on('closed', () => { mainWindow = null }) }
// 开启screen-main新窗口 function openScreen() { var screenWin = new BrowserWindow({ width: 1000, height: 550, useContentSize: true, // parent: mainWindow, webPreferences: { webSecurity: false, // 是否禁用浏览器的跨域安全特性 nodeIntegration: true // 是否完整支持node } }) screenWin.loadURL(mainWindow + '#/screen'); screenWin.on('closed', () => { screenWin = null }) }
ipcMain.on('openScreen', e => { // mainWindow.hide(); openScreen() }
);
app.on('ready', createWindow)
app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit() } })
app.on('activate', () => { if (mainWindow === null) { createWindow() } })
/**
electron-updater
to/* import { autoUpdater } from 'electron-updater'
autoUpdater.on('update-downloaded', () => { autoUpdater.quitAndInstall() })
app.on('ready', () => { if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates() }) */
How can I reproduce this problem?
#
If visual, provide a screenshot.
#
Tell me about your development environment.
If you are looking to suggest an enhancement or feature, then feel free to remove everything above.