mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
修复渲染进程ipcrender.on无法使用的问题
This commit is contained in:
parent
8dc3bf26c6
commit
cc9d182490
@ -13,5 +13,10 @@ domReady().then(() => {
|
|||||||
|
|
||||||
// --------- Expose some API to Renderer process. ---------
|
// --------- Expose some API to Renderer process. ---------
|
||||||
contextBridge.exposeInMainWorld('fs', fs)
|
contextBridge.exposeInMainWorld('fs', fs)
|
||||||
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
|
|
||||||
contextBridge.exposeInMainWorld('removeLoading', removeLoading)
|
contextBridge.exposeInMainWorld('removeLoading', removeLoading)
|
||||||
|
contextBridge.exposeInMainWorld('ipcRenderer', {
|
||||||
|
...ipcRenderer,
|
||||||
|
on: (name: string, callback: () => {}) => {
|
||||||
|
ipcRenderer.on(name, callback)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user