Leptos
Leptos 是一个基于 Rust 的网页框架。你可以在他们的官方网站上阅读更多关于 Leptos 的信息。本指南适用于 Leptos 0.6 版本。
🌐 Leptos is a Rust based web framework. You can read more about Leptos on their official website. This guide is accurate as of Leptos version 0.6.
🌐 Checklist
- 使用 SSG,Tauri 不正式支持基于服务器的解决方案。
- 使用
serve.ws_protocol = "ws",以便热重载 WebSocket 能够正确连接,用于移动开发。 - 启用
withGlobalTauri以确保 Tauri API 可在window.__TAURI__变量中使用,并且可以使用wasm-bindgen导入。
🌐 Example Configuration
-
src-tauri/tauri.conf.json {"build": {"beforeDevCommand": "trunk serve","devUrl": "http://localhost: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"
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站