⭐Using vue-cli 3
and Electron 9
built a modular desktop application template. Convenient packaging and program language switching, with a custom borderless window, including vue-router
, vue-i18n
, axios
, electron-builder
and more common components, as well as some demo functions.
🚀A lightweight, modular template. Added common plugins and demo features. You can happily use the svg
icon in this project, use the i18n
multi-language comfortably, switch the application language (including the native components and the browser page), make network requests more convenient.
- 🍊Basic:
vue-cli
&electron-builder
- 🌕Router:
vue-router
- 🍁Multilingual:
vue-i18n
- 🌝Network Requester:
axios
- 🚅Quick package:
electron-builder
- 💚css preprocessor:
less
- ⛅A custom window without native borders
- 🎨Modular design with object-oriented writing (mainProcess)
- 🍰Language switching for the entire program
- 🐳An svg component based on
svg-sprite-loader
- 🏀
Electron 8
: Demo of some apis. - 🍉
vue-i18n
: Added demonstration of language switching, including language switching effect ofelectron
native menu. - 🍩
axios
: Added request demo. - 🌼Use
ESlint
for code style specification. - 🌠and
vuex
,vue-router
- 🍖I did not use any ui library, you can add as you like.
&
=or
-
🍬Clone this repository
-
🍮Enter the directory
cd vue-cli-electron-template
- 🍙Install dependencies (yarn is recommended)
yarn & npm install
- 🌽Start application
yarn go & npm run go
- 🍭Packaging
yarn packapp & npm run packapp
⚽files:
- 🎰
./vue.config.js
: Contains vue path alias,electron-builder
,i18n
and other related configurations. - ☔
src/background.js
: Main process entry file. - 🐐
src/mainProcess/appManager.js
: Management of the main process. - 🚧
src/main.js
: Vue entry file. - 🏨
src/backend.js
: network request interface andaxios
configuration.
🍀Directories:
- 🌲
src/locales
:i18n
language translation file directory. - 🐓
src/mainProcess
: Main process modular file directory. - 🙀
src/mainProcess/events
: ipc and app event manager. - 🌴
src/mainProcess/menus
: Menu manager. - 🐏
src/mainProcess/plugins
: Currently only translator. - 🙉
src/mainProcess/windows
: windows and windows manager.