mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
feat(window): refactor and improvements (#426)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
5b3210c224
commit
84133b57b8
@@ -60,18 +60,20 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { appWindow, WebviewWindow } from "@tauri-apps/plugin-window";
|
||||
import { getCurrent, Window } from "@tauri-apps/plugin-window";
|
||||
|
||||
const appWindow = getCurrent();
|
||||
|
||||
// manipulating this window
|
||||
await appWindow.setResizable(false);
|
||||
|
||||
// Creating new windows:
|
||||
// loading embedded asset:
|
||||
const webview = new WebviewWindow("theUniqueLabel", {
|
||||
const webview = new Window("theUniqueLabel", {
|
||||
url: "path/to/page.html",
|
||||
});
|
||||
// alternatively, load a remote URL:
|
||||
const webview = new WebviewWindow("theUniqueLabel", {
|
||||
const webview = new Window("theUniqueLabel", {
|
||||
url: "https://github.com/tauri-apps/tauri",
|
||||
});
|
||||
```
|
||||
|
||||
+287
-312
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user