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>