feat: upgrade to electron@29 #467

This commit is contained in:
Leo Wang(草鞋没号)
2024-03-11 11:10:58 +08:00
parent 8a73559962
commit a9952f16c8
3 changed files with 14 additions and 23 deletions

View File

@@ -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
View File

@@ -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
}
}