diff --git a/notes/README/ZH_CN.md b/notes/README/ZH_CN.md index 0a483244..4da075c7 100644 --- a/notes/README/ZH_CN.md +++ b/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!" } + }) } ```