创建参数
Menu.setApplicationMenu(null); //清除菜单
const win = new BrowserWindow({
width: 1280,
height: 768,
maximizable: true, //最大化
minimizable: true, //最小化
resizable: true,
//fullscreenable: true, //全屏
//fullscreen: true,
//simpleFullscreen:true,
icon: path.join(__dirname,'./app.png'),
webPreferences: {
// Use pluginOptions.nodeIntegration, leave this alone
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
nodeIntegration: (process.env
.ELECTRON_NODE_INTEGRATION as unknown) as boolean,
contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION
}
})
事件函数
win.maximize(); //最大化函数
win.unmaximize(); //取消最大化函数
判断函数
win.isMaximized();是否最大化
win.isMinimized();是否最小化: