Full stack, fully typed.
A cutting-edge Rust framework for the modern web.
Leptos is a full-stack, isomorphic Rust web framework leveraging fine-grained reactivity to build declarative user interfaces.
shellcargo new hello_leptos cd hello_leptos cargo add leptos cargo install trunk rustup target add wasm32-unknown-unknown
添加依赖 leptos = { version = "0.6.5", features = ["csr"] }
下载失败需要设置 rust 源
# 放到 `$HOME/.cargo/config` 文件中 [source.crates-io] registry = "https://github.com/rust-lang/crates.io-index" # 替换成你偏好的镜像源 replace-with = 'sjtu' #replace-with = 'ustc' # 清华大学 [source.tuna] registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" # 中国科学技术大学 [source.ustc] registry = "git://mirrors.ustc.edu.cn/crates.io-index" # 上海交通大学 [source.sjtu] registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index" # rustcc社区 [source.rustcc] registry = "git://crates.rustcc.cn/crates.io-index" [net] git-fetch-with-cli=true
启动 trunk serve --open
rustup target add wasm32-unknown-unknown
cargo leptos new --git leptos-rs/start
cargo leptos serve
cargo leptos build
本文作者:42tr
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!