📜  电子指定最小尺寸 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:17.130000             🧑  作者: Mango

代码示例2
const screenElectron = electron.screen;
const display = screenElectron.getPrimaryDisplay();
const dimensions = display.workAreaSize;
mainWindow = new BrowserWindow({
    width: parseInt(dimensions.width * 0.8),
    height: parseInt(dimensions.height * 0.8),
    minWidth: parseInt(dimensions.width * 0.8),
    minHeight: parseInt(dimensions.height * 0.8),
    maxWidth: dimensions.width,
    maxHeight: dimensions.height,
    icon: `${__dirname}/assets/icon.ico`
  });