通过设置全局变量进行通讯
// main.js 主进程给global添加一个全局变量
global.aname = {
yourmsg: 'Hello'
}
// index.html 渲染进程
const remote = require('electron').remote
console.log(remote.getGlobal('aname').yourmsg)
Electron-vue


通过设置全局变量进行通讯
// main.js 主进程给global添加一个全局变量
global.aname = {
yourmsg: 'Hello'
}
// index.html 渲染进程
const remote = require('electron').remote
console.log(remote.getGlobal('aname').yourmsg)
本文标题:Electron主进程与渲染进程之间的通信
本文链接:https://www.haomeiwen.com/subject/gnxrhqtx.html
网友评论