Javascript 增加/扩展按钮单击时电子窗口的高度

Javascript 增加/扩展按钮单击时电子窗口的高度,javascript,react-native,electron,Javascript,React Native,Electron,具有固定高度和宽度的第一个图像 第二张图片,我想在信息太大的情况下,在点击细节按钮时设置电子窗口的高度。我该怎么做 您可以通过渲染器访问浏览器窗口过程: var currentWindow = require("electron").remote.getCurrentWindow(); var currentSize = currentWindow.getSize(); var animate = true; currentWindow.setSize(currentSize[0], curr

具有固定高度和宽度的第一个图像

第二张图片,我想在信息太大的情况下,在点击细节按钮时设置电子窗口的高度。我该怎么做


您可以通过渲染器访问浏览器窗口过程:

var currentWindow = require("electron").remote.getCurrentWindow();
var currentSize = currentWindow.getSize();
var animate = true;
currentWindow.setSize(currentSize[0], currentSize[1] + 100, animate);
var messageWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true } })
不要忘记在main过程中的BrowserWindow构造函数中将nodeIntegration设置为true:

var currentWindow = require("electron").remote.getCurrentWindow();
var currentSize = currentWindow.getSize();
var animate = true;
currentWindow.setSize(currentSize[0], currentSize[1] + 100, animate);
var messageWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true } })