Update ZH_CN.md

This commit is contained in:
YuKun Liu 2022-04-17 11:59:29 +08:00 committed by GitHub
parent 9c0963abe7
commit 9d285d842d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

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