【Electron】MacOS系统区分Dock菜单退出和点击X退出
main.jslet willQuitApp = false;app.on('ready', () => {// 阻止默认退出事件改为最小化到托盘 win.on('close', event => { console.log('win close', willQuitApp); // 判断非显式调用app.quit触发的close事件作最小化到托盘处理 if (!willQuitApp) { event.preventDefault(); .
原创
2022-05-09 14:23:04 ·
1617 阅读 ·
0 评论