Use the ' Electron-quick-start ' sample project, which is officially given by electron, to copy it down,
git clone https://github.com/electron/electron-quick-start.git
There are three main documents:
----index.html start Page
----main.js Displays the window after the project is launched, which can be configured, such as browser window size, start Page settings
----Renderer.js inside the note translation to understand, mainly to put business-related JS, you can access the DOM, you can also use the node API
Then NPM Install module
NPM Start start, you can see a hello world! The box
How do I publish a project as an app?
1. Use the IFRAME label on the start page to introduce the project, i.e.
index.html: <div> <iframe src= "https://www.baidu.com" frameborder= "0"> </iframe> </div > //src The URL of your online project
2. Installation
NPM Install Electron-packager-g
3. Performing Packaging
Electron-packager will automatically determine the current operating system package corresponding files, Win under. exe, MAC next. App
Electron-packager. Aloe--out. /electron-all
Explain:
output the file in the current directory to an electron, and name it Aloe,-all says all the operating systems are packaged once
An easy way to build desktop apps with electron