AGENT SKILL

tauri-multi-window

暂无简介

License 许可
MIT
最近更新
2026-06-24
Stars
★ 67
Forks
24

03 SKILL.md 正文

Tauri Multi-Window

Create Windows from Frontend

import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
const win = new WebviewWindow("settings", {
    url: "/settings", title: "Settings",
    width: 600, height: 400, center: true, resizable: false,
});
win.once("tauri://error", (e) => console.error(e));

Window Controls

import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
const win = getCurrentWebviewWindow();
await win.minimize();
await win.maximize();
await win.hide();
await win.show();
await win.setTitle("New Title");

Close to Tray

await win.onCloseRequested(async (event) => {
    event.preventDefault();
    await win.hide(); // Minimize to tray instead
});

04 同仓库更多 Skills