瀏覽代碼

Update ZH_CN.md

YuKun Liu 3 年之前
父節點
當前提交
9d285d842d
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      notes/README/ZH_CN.md

+ 5 - 5
notes/README/ZH_CN.md

@@ -65,13 +65,13 @@ Dioxus 是一个可移植、高性能的框架,用于在 Rust 中构建跨平
 
 ```rust
 fn app(cx: Scope) -> Element {
-    let count = use_state(&cx, || 0);
+    let mut count = use_state(&cx, || 0);
 
-    cx.render(rsx!(
+    cx.render(rsx! {
         h1 { "High-Five counter: {count}" }
-        button { onclick: move |_| count.set(count + 1), "Up high!" }
-        button { onclick: move |_| count.set(count - 1), "Down low!" }
-    ))
+        button { onclick: move |_| count += 1, "Up high!" }
+        button { onclick: move |_| count -= 1, "Down low!" }
+    })
 }
 ```