Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/electron/electron.git
π Update FAQ to ES6 [ci skip]
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
afe0296e0f
ΠΠΎΠΌΠΌΠΈΡ
3271492c86
|
@ -60,16 +60,16 @@ If you want a quick fix, you can make the variables global by changing your
|
|||
code from this:
|
||||
|
||||
```javascript
|
||||
app.on('ready', function() {
|
||||
var tray = new Tray('/path/to/icon.png');
|
||||
app.on('ready', () => {
|
||||
const tray = new Tray('/path/to/icon.png');
|
||||
})
|
||||
```
|
||||
|
||||
to this:
|
||||
|
||||
```javascript
|
||||
var tray = null;
|
||||
app.on('ready', function() {
|
||||
let tray = null;
|
||||
app.on('ready', () => {
|
||||
tray = new Tray('/path/to/icon.png');
|
||||
})
|
||||
```
|
||||
|
@ -84,7 +84,7 @@ To solve this, you can turn off node integration in Electron:
|
|||
|
||||
```javascript
|
||||
// In the main process.
|
||||
var mainWindow = new BrowserWindow({
|
||||
let mainWindow = new BrowserWindow({
|
||||
webPreferences: {
|
||||
nodeIntegration: false
|
||||
}
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅