728x90
๋ฐ์ํ
[์ค์น]
npm init
npm i electron
[package.json]
{
"main": "main.js",
"scripts": {
"start": "electron ."
}
}
[main.js]
const { app, BrowserWindow, Menu } = require('electron');
Menu.setApplicationMenu(false); // ๋ฉ๋ด ๋นํ์ฑํ
function createWindow(){
let win = new BrowserWindow({
frame: true,
width: 600,
height: 400,
minWidth: 400,
minHeight: 200,
maxWidth: 700,
maxHeight: 500,
resizable: true,
webPreferences:{
nodeIntegration: true,
contextIsolation: false,
devTools: true
}
});
win.loadFile('./index.html');
}
app.on('ready', createWindow);
[index.html]
<html>
<head>
<title>window</title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
[์คํ]
npm start
728x90
๋ฐ์ํ
'๐ฅ๏ธํ๋ก ํธ์๋ > Electron.js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Electron - ๋ ๋๋ฌ๊ฐ ๋ฉ์ธ์๊ฒ ์ ํธ ๋ณด๋ด๊ธฐ(ipcMain & ipcRenderer) (0) | 2022.03.28 |
---|---|
Electron - Tray ์์ฑ ๋ฐ ํด๋ฆญ ์ด๋ฒคํธ, Tray ์์ด์ฝ ๋ณ๊ฒฝ (0) | 2022.03.28 |
Electron - ๋ง์ฐ์ค ๋๋๊ทธ๋ก ์ฐฝ ์์ง์ด๊ธฐ (0) | 2022.03.28 |
Electron - ๋ก๋๊ฐ ๋ค๋ํ์ ์ฐฝ ๋์ฐ๊ธฐ (0) | 2022.03.27 |
Electron - ํด๋ฆฝ๋ณด๋ ์กฐ์ (0) | 2022.03.27 |