Π·Π΅Ρ€ΠΊΠ°Π»ΠΎ ΠΈΠ·
1
0
Π€ΠΎΡ€ΠΊΠ½ΡƒΡ‚ΡŒ 0
This commit is contained in:
electron-bot 2022-03-21 01:22:37 +00:00
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ eff5da8b92
ΠšΠΎΠΌΠΌΠΈΡ‚ 701d21492d
2 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 3 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 3 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -4,5 +4,5 @@ window.electronAPI.handleCounter((event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
event.reply('counter-value', newValue)
event.sender.send('counter-value', newValue)
})

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -395,7 +395,7 @@ module that uses the `webContents.send` API to send an IPC message from the main
target renderer.
```javascript {11-26} title='main.js (Main Process)'
const {app, BrowserWindow, Menu} = require('electron')
const {app, BrowserWindow, Menu, ipcMain} = require('electron')
const path = require('path')
function createWindow () {
@ -541,7 +541,7 @@ window.electronAPI.onUpdateCounter((event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
event.reply('counter-value', newValue)
event.sender.send('counter-value', newValue)
})
```