mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 11:52:07 +08:00
修复前端ipc调用
This commit is contained in:
@@ -10,7 +10,7 @@ const callMain = (ipc, channel, param) => {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// 声明渲染进程函数, 用于主进程函数回调, 返回数据
|
// 声明渲染进程函数, 用于主进程函数回调, 返回数据
|
||||||
// 调用主进程函数
|
// 调用主进程函数
|
||||||
ipc.on(channel, (event, result) => {
|
ipc.once(channel, (event, result) => {
|
||||||
console.log('[ipcRenderer] [callMain] result:', result)
|
console.log('[ipcRenderer] [callMain] result:', result)
|
||||||
resolve(result)
|
resolve(result)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user