Leptos
Leptos 是一个基于 Rust 的 Web 框架。您可以在他们的官方网站上了解更多关于 Leptos 的信息。本指南截至 Leptos 0.6 版都是准确的。
- 使用 SSG,Tauri 不正式支持基于服务器的解决方案。
- 使用
serve.ws_protocol = "ws"
,以便热重载 websocket 可以正确连接以进行移动开发。 - 启用
withGlobalTauri
以确保 Tauri API 在window.__TAURI__
变量中可用,并且可以使用wasm-bindgen
导入。
-
src-tauri/tauri.conf.json {"build": {"beforeDevCommand": "trunk serve","devUrl": "https://:1420","beforeBuildCommand": "trunk build","frontendDist": "../dist"},"app": {"withGlobalTauri": true}} -
Trunk.toml [build]target = "./index.html"[watch]ignore = ["./src-tauri"][serve]port = 1420open = falsews_protocol = "ws"
© 2025 Tauri 贡献者。CC-BY / MIT