From 9c0963abe74fb1d283b781a29859e61d09922ec5 Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Sun, 17 Apr 2022 11:56:30 +0800 Subject: [PATCH] Update ZH_CN.md --- notes/README/ZH_CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes/README/ZH_CN.md b/notes/README/ZH_CN.md index 79f2b51a..0a483244 100644 --- a/notes/README/ZH_CN.md +++ b/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!" } )) } ```