mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Update docs/api/web-contents-view.md
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
This commit is contained in:
@@ -11,14 +11,14 @@ module is emitted.
|
||||
const win = new BaseWindow({ width: 800, height: 400 })
|
||||
|
||||
const view1 = new WebContentsView()
|
||||
win.contentView.addChild(view1)
|
||||
win.contentView.addChildView(view1)
|
||||
view1.webContents.loadURL('https://my.app/one')
|
||||
view1.setBounds({ x: 0, y: 0, width: 400, height: 400 })
|
||||
|
||||
const view2 = new WebContentsView()
|
||||
win.contentView.addChild(view2)
|
||||
win.contentView.addChildView(view2)
|
||||
view2.webContents.loadURL('https://my.app/two')
|
||||
view1.setBounds({ x: 400, y: 0, width: 400, height: 400 })
|
||||
view2.setBounds({ x: 400, y: 0, width: 400, height: 400 })
|
||||
```
|
||||
|
||||
## Class: WebContentsView extends `View`
|
||||
|
||||
Reference in New Issue
Block a user