我是Electron的新手,想知道如何将数据从表单获取到main.js(启动Electron的主文件)中。我的index.html文件中的代码段如下:
<form id="creds">
<h3 class="username">Username</h3>
<input id="username" class="form-control text-input" placeholder="Username">
<input type="submit" value="Submit">
</form>Run Code Online (Sandbox Code Playgroud)
我读到有关ipcMain和ipcRenderer的信息,但是在点击“提交”按钮后,我无法弄清楚使用什么代码从index.html获取数据。