【发布时间】:2020-08-07 07:30:11
【问题描述】:
我正在使用Electron 10 和Node v12.6.3。
我尝试从渲染器进程打开一个 FileDialog。这不是关于这个问题的第一个问题,但我找不到任何适合我的解决方案。 nodeIntegrations 已启用
win = new BrowserWindow({
webPreferences: {
webSecurity: false,
nodeIntegrationInWorker: true,
nodeIntegration: true,
allowRunningInsecureContent: (serve) ? true : false,
},
我尝试了以下方法:
1) import * as electron from "electron";
2) import { remote } from "electron";
3) var remote = require("electron").remote;
...
还在函数中执行require("electron").remote,返回undefined。我会在这里错过什么?
在任何情况下,remote 似乎都未定义。谁能帮我?我迷路了。
【问题讨论】: