修复渲染进程ipcrender.on无法使用的问题

This commit is contained in:
renlu 2021-11-25 18:20:28 +08:00
parent 8dc3bf26c6
commit cc9d182490

View File

@ -13,5 +13,10 @@ domReady().then(() => {
// --------- Expose some API to Renderer process. ---------
contextBridge.exposeInMainWorld('fs', fs)
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
contextBridge.exposeInMainWorld('removeLoading', removeLoading)
contextBridge.exposeInMainWorld('ipcRenderer', {
...ipcRenderer,
on: (name: string, callback: () => {}) => {
ipcRenderer.on(name, callback)
}
})