Electron is hot right now, and the tagline on its website is to build cross-platform desktop applications using JavaScript, HTML, and CSS. There is just no specific use development project, so just try creating a Vue project and using the old project to see if you can package it.
I have tried both the new project and the old project, and found several methods. I will use one here, which I think is relatively simple.
To create a new VUE project, this step will not be covered:
vue create electron-demo
Install electron, no global:
npm install electron
It is easy to report errors:
Vuecli add module, this command is add module, you can go to vuecli check:
vue add electron-builder
Will give you a choice, choose the highest:
Errors are often reported here:
CNPM: yes, I did not download the file properly.
npm run electron:serve
If there is an error, please download it again. I did not install it successfully at the first time, I do not know whether it is related to the network. After executing NPM run electron:serve, please wait for a moment.
Then came the packing:
npm run electron:build
This side is particularly slow, I need to download several GitHub compressed files such as electron-v11.3.0-win32-x64.zip, often fail, I wonder if -g will be better when installing.
Packing successfully:
Dist_electron has been added to the project. Exe is the dist_electron client. Double-click it to start it. This will generate the corresponding.exe in C:\Users\dell\AppData\Local.
If the command is the same as in the old project, install ELECTRON first and then add the packing module. To develop, run NPM Run electron:serve, then modify the code, review the elements, and also support hot updates:
If you use a desktop program, there are still some adjustments to be made, such as the width and height of the viewport I use for this project is not suitable.
This is probably the case. Electron has not tried any API but successfully packaged.exe. The specific API will not be fully understood until application development.
Coding Personal note subscription number