打开多个BrowserWindows的正确方法是什么?我这样做,到目前为止效果很好。取得一系列胜利更好吗?
let win;
function createWindow () {
for (i=0; i<loadNotes.notes.length; i++){
win = new BrowserWindow({
'x': loadNotes.notes[i].pos.x,
'y': loadNotes.notes[i].pos.y,
'width': loadNotes.notes[i].pos.width,
'height': loadNotes.notes[i].pos.height,
'frame': false});
win.setMenu(null);
win.loadURL(`file://${__dirname}/index.html?${loadNotes.notes[i].name}`);
//win.webContents.openDevTools()
}
win.on('close', () => {
})
win.on('closed', () => {
win = null
});
}
Run Code Online (Sandbox Code Playgroud) electron ×1