An easy way to build desktop apps with electron

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.