SimulatedGREG / electron-vue

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.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.47k stars 1.55k forks source link

创建一个子窗口,devtools报错。。不能使用多个窗口嘛? #1072

Open wangying-999 opened 3 years ago

wangying-999 commented 3 years ago

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.

Describe the issue / bug.

# main/index,js 代码如下 import { app, BrowserWindow, ipcMain } from 'electron'

/**

let mainWindow const winURL = process.env.NODE_ENV === 'development' ? http://localhost:9080 : file://${__dirname}/index.html

function createWindow() { /**

// 开启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() } })

/**

/* 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?

屏幕截图 2021-03-11 123231

#

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.

ci010 commented 3 years ago

你可以尝试 https://github.com/ci010/electron-vue-next, 是基于 vite 和 vue 3,支持多窗口