1
0
YuKun Liu 3 жил өмнө
parent
commit
9c0963abe7
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      notes/README/ZH_CN.md

+ 3 - 3
notes/README/ZH_CN.md

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