mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-08-26 06:41:19 +08:00
communication declare
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* Renderer and Main bridge
|
||||
* @refresh https://newbedev.com/how-to-use-preload-js-properly-in-electron
|
||||
*/
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
import fs from 'fs'
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
|
||||
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
|
||||
|
||||
contextBridge.exposeInMainWorld('fs', fs)
|
||||
|
||||
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
|
||||
|
@@ -3,5 +3,8 @@ import App from './App.vue'
|
||||
import './index.css'
|
||||
|
||||
createApp(App)
|
||||
.mount('#app')
|
||||
.$nextTick(window.removeLoading)
|
||||
.mount('#app')
|
||||
.$nextTick(window.removeLoading)
|
||||
|
||||
console.log('fs', window.fs)
|
||||
console.log('ipcRenderer', window.ipcRenderer)
|
||||
|
Reference in New Issue
Block a user