mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
Merge pull request #288 from jaw52/fix/open_child_window
Fix/open child window
This commit is contained in:
commit
dfa7f855f9
3
.gitignore
vendored
3
.gitignore
vendored
@ -23,4 +23,7 @@ dist-ssr
|
|||||||
|
|
||||||
release
|
release
|
||||||
.vscode/.debug.env
|
.vscode/.debug.env
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
|
yarn.lock
|
||||||
dist-electron
|
dist-electron
|
||||||
|
@ -101,13 +101,15 @@ ipcMain.handle('open-win', (event, arg) => {
|
|||||||
const childWindow = new BrowserWindow({
|
const childWindow = new BrowserWindow({
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload,
|
preload,
|
||||||
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (app.isPackaged) {
|
if (app.isPackaged) {
|
||||||
childWindow.loadFile(indexHtml, { hash: arg })
|
childWindow.loadFile(indexHtml, { hash: arg })
|
||||||
} else {
|
} else {
|
||||||
childWindow.loadURL(`${url}/#${arg}`)
|
childWindow.loadURL(`${url}#${arg}`)
|
||||||
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
|
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user