mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
docs: update example for in webview ts api (#13272)
This commit is contained in:
@@ -108,11 +108,23 @@ export type WebviewLabel = string
|
||||
*
|
||||
* // loading embedded asset:
|
||||
* const webview = new Webview(appWindow, 'theUniqueLabel', {
|
||||
* url: 'path/to/page.html'
|
||||
* url: 'path/to/page.html',
|
||||
*
|
||||
* // create a webview with specific logical position and size
|
||||
* x: 0,
|
||||
* y: 0,
|
||||
* width: 800,
|
||||
* height: 600,
|
||||
* });
|
||||
* // alternatively, load a remote URL:
|
||||
* const webview = new Webview(appWindow, 'theUniqueLabel', {
|
||||
* url: 'https://github.com/tauri-apps/tauri'
|
||||
*
|
||||
* // create a webview with specific logical position and size
|
||||
* x: 0,
|
||||
* y: 0,
|
||||
* width: 800,
|
||||
* height: 600,
|
||||
* });
|
||||
*
|
||||
* webview.once('tauri://created', function () {
|
||||
@@ -148,7 +160,13 @@ class Webview {
|
||||
* import { Webview } from '@tauri-apps/api/webview'
|
||||
* const appWindow = new Window('my-label')
|
||||
* const webview = new Webview(appWindow, 'my-label', {
|
||||
* url: 'https://github.com/tauri-apps/tauri'
|
||||
* url: 'https://github.com/tauri-apps/tauri',
|
||||
*
|
||||
* // create a webview with specific logical position and size
|
||||
* x: 0,
|
||||
* y: 0,
|
||||
* width: 800,
|
||||
* height: 600,
|
||||
* });
|
||||
* webview.once('tauri://created', function () {
|
||||
* // webview successfully created
|
||||
|
||||
Reference in New Issue
Block a user