方法一:主线程与渲染线程通信
(1)在主线程目录main的index.js配置如下,其中 mainWindow是BrowserWindow对象
...
const template = [{
label: '主页',
click() {
mainWindow.webContents.send('href', 'home');
}
},
{
label: '设备',
click() {
mainWindow.webContents.send('href', 'device');
}
},
{
label: '配置',
click() {
mainWindow.webContents.send('href', 'config');
}
}
];
const menu &#