mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
2.4 KiB
2.4 KiB
electron-vue-vite
🥳 Simple Electron
+ Vue3
+ Vite2
boilerplate. Build based on rollup and ⚡️vite.
Feature
-
HRM
Main process
hot restartPreload script
hot reloadRenderer process
hot module replacement -- power by Vite
-
Beautiful log -- power by concurrently
[R]
meansRenderer process
[P]
meansPreload script
[M]
meansMain process
Run Setup
# clone the project
git clone git@github.com:caoxiemeihao/electron-vue-vite.git
# enter the project directory
cd electron-vue-vite
# install dependency(Recommend use yarn)
yarn
# develop
yarn dev
Communication
-
All NodeJs、Electron API invoke passed
Preload script
-
src/preload/index.ts
// --------- Expose some API to Renderer process. --------- contextBridge.exposeInMainWorld('fs', fs) contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
-
typings/global.d.ts
interface Window { fs: typeof import('fs') ipcRenderer: import('electron').IpcRenderer }
-
src/render/main.ts
console.log('fs', window.fs) console.log('ipcRenderer', window.ipcRenderer)
-
Branchs
- ant-design-vue
- Use tsx
- Integration ant-design-vue
- element-plus
登录窗口、element-ui 这个可能很适合你
🚀- With multiple BrowserWindow
- Integration element-plus