当前位置:网站首页>2. Electron's HelloWorld
2. Electron's HelloWorld
2022-04-23 17:09:00 【Curious rookie】
The official tutorial :https://www.electronjs.org/docs/latest/tutorial/quick-start
Environment building :1.Electron Development environment construction
Fast experience :
# Clone the warehouse
$ git clone https://github.com/electron/electron-quick-start
# Enter warehouse
$ cd electron-quick-start
# Install dependent libraries and run applications
$ npm install && npm start
Write your own
One 、HelloWorld Interface writing
1、 Create a new working directory :F:\study\electron\helloworld
2、 Use editor (VScode) Open the working directory and create a new one index.html file
3、 Write interface content
html:5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HelloWorld</title>
</head>
<body>
HelloWorld
</body>
</html>
Two 、 To write main.js, introduce electron Work
var electron = require('electron') // introduce electron Components
var app = electron.app // Import components app
var BrowserWindow = electron.BrowserWindow // Window reference
var mainWindow = null // Declare open window
app.on('ready', () => { //app Initialize parameters
mainWindow = new BrowserWindow({ windth: 800, height: 800 })
mainWindow.loadFile('index.html') // Open the page loaded by the window
mainWindow.on('close', () => { // When the window is closed , Release the page
mainWindow = null
})
})
3、 ... and 、 Initialize project
npm init --yes
Four 、 Run the project
electron .
Project directory structure
版权声明
本文为[Curious rookie]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231707156943.html
边栏推荐
- The new MySQL table has a self increasing ID of 20 bits. The reason is
- Aiot industrial technology panoramic structure - Digital Architecture Design (8)
- Clickhouse SQL operation
- Getting started with JDBC
- First knowledge of go language
- Shell-awk命令的使用
- Shell-入门、变量、以及基本的语法
- 1-3 components and modules
- Go language RPC communication
- JS, entries(), keys(), values(), some(), object Assign() traversal array usage
猜你喜欢
Get the column name list of the table quickly in Oracle
Shell script -- shell programming specification and variables
Lock锁
Nacos + aspnetcore + Ocelot actual combat code
快时钟同步慢时钟域下的异步控制信号slow clk to fast clk
Sub database and sub table & shardingsphere
Installing labellmg tutorial in Windows
Change the password after installing MySQL in Linux
How much do you know about the process of the interview
The new MySQL table has a self increasing ID of 20 bits. The reason is
随机推荐
Detailed explanation of the penetration of network security in the shooting range
feign报400处理
Lock锁
C# Task. Delay and thread The difference between sleep
Solution architect's small bag - 5 types of architecture diagrams
Detailed explanation of Niuke - Gloves
Shell脚本——Shell编程规范及变量
Wiper component encapsulation
Talk about browser cache control
C语言函数详解
Your brain expands and shrinks over time — these charts show how
AIOT产业技术全景结构-数字化架构设计(8)
. net cross platform principle (Part I)
Net standard
Nodejs reads the local JSON file through require. Unexpected token / in JSON at position appears
Shell - introduction, variables, and basic syntax
Shell-awk命令的使用
Paging the list collection
Basic case of Baidu map
Multithreaded @ async thread pool