#ssg #react #ui #web-framework #gui #web-apps

dioxus-static-site-generation

Dioxus 的静态站点生成

2 个版本

0.6.0-alpha.22024年8月7日
0.6.0-alpha.02024年8月1日

#1510 in Web编程

Download history 93/week @ 2024-07-26 182/week @ 2024-08-02 50/week @ 2024-08-09

每月325次下载

MIT/Apache

345KB
6K SLoC

Dioxus 全栈

Crates.io MIT licensed Build Status Discord chat

网站 | 指南 | API 文档 | 聊天

Dioxus 框架的全栈工具。

功能

示例

30行代码内的全栈 Dioxus

#![allow(non_snake_case)]
use dioxus::prelude::*;

fn main() {
    launch(App);
}

#[component]
fn App() -> Element {
    let meaning = use_signal(|| None);

    rsx! {
        h1 { "Meaning of life: {meaning:?}" }
        button {
            onclick: move |_| async move {
                if let Ok(data) = get_meaning("life the universe and everything".into()).await {
                    meaning.set(data);
                }
            },
            "Run a server function"
        }
    }
}

#[server]
async fn get_meaning(of: String) -> Result<Option<u32>, ServerFnError> {
    Ok(of.contains("life").then(|| 42))
}

入门

要开始使用全栈 Dioxus,请查看我们的入门指南全栈示例

贡献

  • 在我们的问题跟踪器中报告问题。
  • 加入 Discord 并提问!

许可证

本项目采用MIT许可证

除非您明确声明,否则您有意提交以包含在 Dioxus 中的任何贡献均应按 MIT 许可,无任何附加条款或条件。

依赖关系

~14–32MB
~543K SLoC