美文网首页
屏蔽原生的边框及菜单

屏蔽原生的边框及菜单

作者: 小小一小只 | 来源:发表于2017-11-16 13:00 被阅读0次
  • 屏蔽菜单及原生边框
mainWindow = new BrowserWindow({
    // other set
    //autoHideMenuBar: Boolean, // 除非点击 Alt,否则隐藏菜单栏.默认为 false.
    frame: false
  })
  • 模拟设置及菜单
  ...some HTML
  js
    利用ipc通信将事件从渲染进程通知到主进程中
    渲染进程: this.$electron.ipcRenderer.send('close')
    主进程 :  ipcMain.on('close',()=>{
                  mainWindow = null
                  app.quit()
                })
  style:
    style=”-webkit-app-region: drag;” 用于设定该部分为可拖动区域; 
    style=”-webkit-app-region: no-drag;” 用于设定该部分为不可拖动区域;

相关文章

网友评论

      本文标题:屏蔽原生的边框及菜单

      本文链接:https://www.haomeiwen.com/subject/inrlvxtx.html