mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
example: update example
This commit is contained in:
parent
31a2ded2b9
commit
3f4897cd1c
1 changed files with 3 additions and 3 deletions
|
@ -9,14 +9,14 @@ fn app(cx: Scope) -> Element {
|
||||||
let window = use_window(&cx);
|
let window = use_window(&cx);
|
||||||
|
|
||||||
let level = use_state(&cx, || 1.0);
|
let level = use_state(&cx, || 1.0);
|
||||||
|
|
||||||
window.set_zoom_level(*level.get());
|
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
input {
|
input {
|
||||||
r#type: "number",
|
r#type: "number",
|
||||||
value: "{level}",
|
value: "{level}",
|
||||||
oninput: |e| {
|
oninput: |e| {
|
||||||
level.set(e.value.parse::<f64>().unwrap_or_default())
|
let num = e.value.parse::<f64>().unwrap_or(1.0);
|
||||||
|
level.set(num);
|
||||||
|
window.set_zoom_level(num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue