mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 03:46:35 +08:00
chore: VITE_DEV_SERVER_URL instead app.isPackaged
This commit is contained in:
parent
f55466cdad
commit
c43f6484b9
@ -96,7 +96,7 @@ app.on('activate', () => {
|
||||
}
|
||||
})
|
||||
|
||||
// new window example arg: new windows url
|
||||
// New window example arg: new windows url
|
||||
ipcMain.handle('open-win', (event, arg) => {
|
||||
const childWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
@ -106,10 +106,9 @@ ipcMain.handle('open-win', (event, arg) => {
|
||||
},
|
||||
})
|
||||
|
||||
if (app.isPackaged) {
|
||||
childWindow.loadFile(indexHtml, { hash: arg })
|
||||
} else {
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
childWindow.loadURL(`${url}#${arg}`)
|
||||
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
|
||||
} else {
|
||||
childWindow.loadFile(indexHtml, { hash: arg })
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user