如何在不使用远程的情况下在 Electron 渲染过程中打开 dialog.showSaveDialog?
How would I open a dialog.showSaveDialog in the Electron render process without the use of remote?
如何在不使用远程的情况下在 Electron 渲染过程中打开 dialog.showSaveDialog?从 Electron 14 开始,render
模块不再可用,而且似乎也不鼓励使用 @electron/remote
,所以我想知道目前“正确”的方式是什么。
类似于:
主要
ipcMain.handle('some-handler', async (event, someConfig) => {
const result = await someFuncThatDoesYourContextMenu(someConfig);
return result;
}
在渲染器中
const result = await ipcRenderer.invoke('some-handler', someConfig);
如何在不使用远程的情况下在 Electron 渲染过程中打开 dialog.showSaveDialog?从 Electron 14 开始,render
模块不再可用,而且似乎也不鼓励使用 @electron/remote
,所以我想知道目前“正确”的方式是什么。
类似于:
主要
ipcMain.handle('some-handler', async (event, someConfig) => {
const result = await someFuncThatDoesYourContextMenu(someConfig);
return result;
}
在渲染器中
const result = await ipcRenderer.invoke('some-handler', someConfig);