feat:init

This commit is contained in:
shixh4 2023-01-30 16:15:29 +08:00
commit 65741ec137
3 changed files with 44 additions and 0 deletions

15
index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
</body>
</html>

15
main.js Normal file
View File

@ -0,0 +1,15 @@
// npm start
const { app, BrowserWindow } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
})

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "my-electron-app",
"version": "1.0.0",
"description": "Hello World!",
"main": "main.js",
"author": "hua",
"license": "MIT",
"devDependencies": {
"electron": "^22.1.0"
},
"scripts": {
"start": "electron ."
}
}