fix(example): fix open childWindow error

This commit is contained in:
jaw52 2022-10-21 16:34:14 +08:00
parent 17142a9ec8
commit a6d8b6febd

View File

@ -101,13 +101,15 @@ ipcMain.handle('open-win', (event, arg) => {
const childWindow = new BrowserWindow({
webPreferences: {
preload,
nodeIntegration: true,
contextIsolation: false,
},
})
if (app.isPackaged) {
childWindow.loadFile(indexHtml, { hash: arg })
} else {
childWindow.loadURL(`${url}/#${arg}`)
childWindow.loadURL(`${url}#${arg}`)
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
}
})