1.preload.js里暴露接口
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
WindowMin: (data) => {
ipcRenderer.send('window-min', data);
}
});
2.vue文件处理
if(window.electronAPI){
window.electronAPI.WindowMin("")
}
https://github.com/electron/electron-quick-start