mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
fix: calculator example
This commit is contained in:
parent
859be4a2f6
commit
db5b1e1916
1 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ fn main() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clac_val(val: String) -> f64 {
|
fn calc_val(val: String) -> f64 {
|
||||||
|
|
||||||
let mut result = 0.0_f64;
|
let mut result = 0.0_f64;
|
||||||
let mut temp = String::new();
|
let mut temp = String::new();
|
||||||
|
@ -124,7 +124,7 @@ fn app(cx: Scope) -> Element {
|
||||||
button {
|
button {
|
||||||
class: "calculator-key key-percent",
|
class: "calculator-key key-percent",
|
||||||
onclick: move |_| {
|
onclick: move |_| {
|
||||||
cur_val.set(clac_val(display_value.get().clone()) / 100.0);
|
cur_val.set(calc_val(display_value.get().clone()) / 100.0);
|
||||||
},
|
},
|
||||||
"%"
|
"%"
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ fn app(cx: Scope) -> Element {
|
||||||
}
|
}
|
||||||
button { class: "calculator-key key-equals",
|
button { class: "calculator-key key-equals",
|
||||||
onclick: move |_| {
|
onclick: move |_| {
|
||||||
cur_val.set(clac_val(display_value.get().clone()));
|
cur_val.set(calc_val(display_value.get().clone()));
|
||||||
},
|
},
|
||||||
"="
|
"="
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue