mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-08-29 00:57:49 +08:00
feat: upgrade to electron@29 #467
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
window.ipcRenderer.on('main-process-message', (_event, ...args) => {
|
||||
console.log('[Receive Main-process message]:', ...args)
|
||||
window.app.onEvent((channel, ...args) => {
|
||||
console.log(channel, ...args)
|
||||
})
|
||||
|
6
src/vite-env.d.ts
vendored
6
src/vite-env.d.ts
vendored
@@ -7,6 +7,8 @@ declare module '*.vue' {
|
||||
}
|
||||
|
||||
interface Window {
|
||||
// expose in the `electron/preload/index.ts`
|
||||
ipcRenderer: import('electron').IpcRenderer
|
||||
app: {
|
||||
// Expose in the `electron/preload/index.ts`
|
||||
onEvent: (cb: (channel: string, ...args: any[]) => void) => void
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user