Electron 通信

1、web向主进程发送消息 (单项)

使用ipcMain.on 监听事件

const hanle = (event, data) => {
    console.log(event)
    console.log(data)
}

ipcMain.on('close', handle)

使用 ipcRenderer.send 发送

ipcRenderer.send('close', {msg: ''})

 

  • 1、web向主进程发送消息 (单项)
posted @   时光凉忆  阅读(55)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)
点击右上角即可分享
微信分享提示