Update docs/api/web-contents-view.md

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
This commit is contained in:
Jeremy Rose
2023-04-24 14:59:16 -07:00
committed by GitHub
parent 64178a46cf
commit a7fec0b561

View File

@@ -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`