0
我已經在創建窗口時設置了窗口的寬度和高度,現在我又想在我調用ipc時更改同一窗口的寬度和高度主要過程。 這裏是我的代碼如何在電子中設置當前窗口的寬度和高度
function createWindow() {
win = new BrowserWindow({
width: 448, // here I have set the width and height
height: 650,
frame: false,
transparent: true,
minimizable: true,
maximizable: true,
closable: true,
})
win.loadURL(url.format({
pathname: path.join(__dirname, './view/loginWindow.html'),
protocol: 'file:',
slashes: true
}))
.....
....
現在我調用IPC方法
ipcMain.on('userRegLinkClicked', (event, data) => {
win.setSize({
width: 448,
height: 850
})
}
但沒有任何作品,而不是我的錯誤TypeError: Error processing argument at index 0, conversion failure from #<Object>