docs fixes

This commit is contained in:
Jeremy Rose
2023-04-24 16:34:57 -07:00
parent e058817206
commit ffb2bd1ccc
2 changed files with 11 additions and 11 deletions

View File

@@ -20,11 +20,11 @@ const win = new BaseWindow({ width: 800, height: 600 })
const leftView = new WebContentsView()
leftView.webContents.loadURL('https://electronjs.org')
mainWindow.contentView.addChildView(leftView)
win.contentView.addChildView(leftView)
const rightView = new WebContentsView()
rightView.webContents.loadURL('https://slack.com')
mainWindow.contentView.addChildView(rightView)
rightView.webContents.loadURL('https://github.com/electron/electron')
win.contentView.addChildView(rightView)
leftView.setBounds({ x: 0, y: 0, width: 400, height: 600 })
rightView.setBounds({ x: 400, y: 0, width: 400, height: 600 })
@@ -37,11 +37,11 @@ By using `parent` option, you can create child windows:
```javascript
const { BaseWindow } = require('electron')
const top = new BaseWindow()
const child = new BaseWindow({ parent: top })
const parent = new BaseWindow()
const child = new BaseWindow({ parent })
```
The `child` window will always show on top of the `top` window.
The `child` window will always show on top of the `parent` window.
## Modal windows
@@ -51,8 +51,8 @@ window, you have to set both `parent` and `modal` options:
```javascript
const { BaseWindow } = require('electron')
const top = new BaseWindow()
const child = new BaseWindow({ parent: top, modal: true })
const parent = new BaseWindow()
const child = new BaseWindow({ parent, modal: true })
```
## Platform notices

View File

@@ -12,12 +12,12 @@ const win = new BaseWindow({ width: 800, height: 400 })
const view1 = new WebContentsView()
win.contentView.addChildView(view1)
view1.webContents.loadURL('https://my.app/one')
view1.webContents.loadURL('https://electronjs.org')
view1.setBounds({ x: 0, y: 0, width: 400, height: 400 })
const view2 = new WebContentsView()
win.contentView.addChildView(view2)
view2.webContents.loadURL('https://my.app/two')
view2.webContents.loadURL('https://github.com/electron/electron')
view2.setBounds({ x: 400, y: 0, width: 400, height: 400 })
```
@@ -113,7 +113,7 @@ Use this to interact with the `WebContents`, for instance to load a URL.
```javascript
const view = new WebContentsView()
view.webContents.loadURL('https://my.app/')
view.webContents.loadURL('https://electronjs.org/')
```
#### `view.children` _Readonly_