2 Commits

Author SHA1 Message Date
Haojie Ning
a085952032 fix: resolve ipcRenderer no returns (#478) 2024-03-28 22:08:07 +08:00
Leo Wang(草鞋没号)
c7e5fd70cd chore: bump vite-plugin-electron to 0.28.4 2024-03-17 11:03:37 +08:00
2 changed files with 5 additions and 5 deletions

View File

@@ -4,19 +4,19 @@ import { ipcRenderer, contextBridge } from 'electron'
contextBridge.exposeInMainWorld('ipcRenderer', {
on(...args: Parameters<typeof ipcRenderer.on>) {
const [channel, listener] = args
ipcRenderer.on(channel, (event, ...args) => listener(event, ...args))
return ipcRenderer.on(channel, (event, ...args) => listener(event, ...args))
},
off(...args: Parameters<typeof ipcRenderer.off>) {
const [channel, ...omit] = args
ipcRenderer.off(channel, ...omit)
return ipcRenderer.off(channel, ...omit)
},
send(...args: Parameters<typeof ipcRenderer.send>) {
const [channel, ...omit] = args
ipcRenderer.send(channel, ...omit)
return ipcRenderer.send(channel, ...omit)
},
invoke(...args: Parameters<typeof ipcRenderer.invoke>) {
const [channel, ...omit] = args
ipcRenderer.invoke(channel, ...omit)
return ipcRenderer.invoke(channel, ...omit)
},
// You can expose other APTs you need here.

View File

@@ -30,7 +30,7 @@
"electron-builder": "^24.13.3",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vite-plugin-electron": "^0.28.2",
"vite-plugin-electron": "^0.28.4",
"vite-plugin-electron-renderer": "^0.14.5",
"vue": "^3.4.21",
"vue-tsc": "^2.0.6"