mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +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) => {
|
ipcMain.handle('open-win', (event, arg) => {
|
||||||
const childWindow = new BrowserWindow({
|
const childWindow = new BrowserWindow({
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -106,10 +106,9 @@ ipcMain.handle('open-win', (event, arg) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (app.isPackaged) {
|
if (process.env.VITE_DEV_SERVER_URL) {
|
||||||
childWindow.loadFile(indexHtml, { hash: arg })
|
|
||||||
} else {
|
|
||||||
childWindow.loadURL(`${url}#${arg}`)
|
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