2020-08-16 12:49:24 +08:00
|
|
|
# electron-vue-vite
|
2021-03-30 09:57:22 +08:00
|
|
|
`Electron` + `Vue3` + `Vite2` integration
|
2020-08-16 20:42:52 +08:00
|
|
|
|
|
|
|
## How and Why
|
2021-03-30 09:57:22 +08:00
|
|
|
- `Vite` is the scaffold of the future
|
2020-08-16 21:00:37 +08:00
|
|
|
|
2020-10-05 21:48:49 +08:00
|
|
|
## Command
|
2020-08-17 09:21:07 +08:00
|
|
|
- npm run dev
|
|
|
|
- npm run build
|
2020-08-16 21:00:37 +08:00
|
|
|
|
2021-03-30 09:57:22 +08:00
|
|
|
## Note
|
|
|
|
- Using `Nodejs` `Electron` API in vite and using require to import
|
|
|
|
```ts
|
|
|
|
// import { readFile } from 'fs'
|
|
|
|
// import { ipcRenderer } from 'electron'
|
2020-10-05 21:48:49 +08:00
|
|
|
|
2021-03-30 09:57:22 +08:00
|
|
|
const { readFile } = require('fs')
|
|
|
|
const { ipcRenderer } = require('electron')
|
2021-02-18 16:26:59 +08:00
|
|
|
```
|
2020-09-02 09:19:15 +08:00
|
|
|
|
2020-08-17 09:21:07 +08:00
|
|
|
---
|
2020-08-16 21:00:37 +08:00
|
|
|
|
2021-03-30 09:57:22 +08:00
|
|
|
![](https://raw.githubusercontent.com/caoxiemeihao/electron-vue-vite/main/screenshot/800x600-2.png)
|
2021-05-08 17:29:38 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
[MIT License](https://opensource.org/licenses/MIT)
|