mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 03:46:35 +08:00
Merge branch 'main' of github.com:electron-vite/electron-vite-vue into main
This commit is contained in:
commit
7d5708d600
@ -4,19 +4,19 @@ import { ipcRenderer, contextBridge } from 'electron'
|
|||||||
contextBridge.exposeInMainWorld('ipcRenderer', {
|
contextBridge.exposeInMainWorld('ipcRenderer', {
|
||||||
on(...args: Parameters<typeof ipcRenderer.on>) {
|
on(...args: Parameters<typeof ipcRenderer.on>) {
|
||||||
const [channel, listener] = args
|
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>) {
|
off(...args: Parameters<typeof ipcRenderer.off>) {
|
||||||
const [channel, ...omit] = args
|
const [channel, ...omit] = args
|
||||||
ipcRenderer.off(channel, ...omit)
|
return ipcRenderer.off(channel, ...omit)
|
||||||
},
|
},
|
||||||
send(...args: Parameters<typeof ipcRenderer.send>) {
|
send(...args: Parameters<typeof ipcRenderer.send>) {
|
||||||
const [channel, ...omit] = args
|
const [channel, ...omit] = args
|
||||||
ipcRenderer.send(channel, ...omit)
|
return ipcRenderer.send(channel, ...omit)
|
||||||
},
|
},
|
||||||
invoke(...args: Parameters<typeof ipcRenderer.invoke>) {
|
invoke(...args: Parameters<typeof ipcRenderer.invoke>) {
|
||||||
const [channel, ...omit] = args
|
const [channel, ...omit] = args
|
||||||
ipcRenderer.invoke(channel, ...omit)
|
return ipcRenderer.invoke(channel, ...omit)
|
||||||
},
|
},
|
||||||
|
|
||||||
// You can expose other APTs you need here.
|
// You can expose other APTs you need here.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user