mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
Update ZH_CN.md
This commit is contained in:
parent
78e6064c9b
commit
9c0963abe7
1 changed files with 3 additions and 3 deletions
|
@ -65,12 +65,12 @@ Dioxus 是一个可移植、高性能的框架,用于在 Rust 中构建跨平
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn app(cx: Scope) -> Element {
|
fn app(cx: Scope) -> Element {
|
||||||
let (count, set_count) = use_state(&cx, || 0);
|
let count = use_state(&cx, || 0);
|
||||||
|
|
||||||
cx.render(rsx!(
|
cx.render(rsx!(
|
||||||
h1 { "High-Five counter: {count}" }
|
h1 { "High-Five counter: {count}" }
|
||||||
button { onclick: move |_| set_count(count + 1), "Up high!" }
|
button { onclick: move |_| count.set(count + 1), "Up high!" }
|
||||||
button { onclick: move |_| set_count(count - 1), "Down low!" }
|
button { onclick: move |_| count.set(count - 1), "Down low!" }
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue