Kısa süre önce ayaklarımın Elektron ile ıslanmasına başladım. Arkasındaki ilkeleri gerçekten çok seviyorum ama bazı şeyler yapmak için biraz kafa karıştırıcı buluyorum.Elektron - İşleme Girişi
Örneğin, kullanıcı girişini nasıl işlersiniz? Bir main.js ve bir yerel html dosyasına işaret eden bir BrowserWindow (giriş alanıyla bazı kullanıcı ayarlarını içeren) kullanıyorum.
HTML formu gönderildiğinde (aynı dosyaya veya başka birine) bu verilere nasıl erişirim?
main.js Electron ile
const {app, BrowserWindow} = require('electron')
let win
function createWindow() {
win = new BrowserWindow({width: 800, height: 600})
win.loadURL('file://' + __dirname + '/index.html')
// Emitted when the window is closed.
win.on('closed',() => {
win = null
})
// Open the DevTools.
// win.webContents.openDevTools()
}
app.on('window-all-closed',() => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate',() => {
if (win === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
//Start the main window
app.on('ready', createWindow)
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="" method="post">
<input type="text" name="test-1">
</form>
</body>
</html>