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

This commit is contained in:
renlu 2021-11-25 18:44:28 +08:00
parent cc9d182490
commit d0133950e7

View File

@ -16,7 +16,7 @@ contextBridge.exposeInMainWorld('fs', fs)
contextBridge.exposeInMainWorld('removeLoading', removeLoading)
contextBridge.exposeInMainWorld('ipcRenderer', {
...ipcRenderer,
on: (name: string, callback: () => {}) => {
ipcRenderer.on(name, callback)
on(...args: Parameters<IpcRenderer['on']>) {
return ipcRenderer.on(...args)
}
})