small change in example
This commit is contained in:
+3
-7
@@ -83,12 +83,6 @@ pub mod todo_example {
|
|||||||
pub mod login_example {
|
pub mod login_example {
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub fn second_screen(usr: String, psw: String) -> Element {
|
|
||||||
rsx! {
|
|
||||||
text { "Username: {usr}\nPassword: {psw}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn app() -> Element {
|
pub fn app() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
@SetStyle(styling())
|
@SetStyle(styling())
|
||||||
@@ -99,7 +93,9 @@ pub mod login_example {
|
|||||||
}, "username: " }
|
}, "username: " }
|
||||||
input { class: "input", id: "psw", on_click: fn(psw: &mut Input, _, document) {
|
input { class: "input", id: "psw", on_click: fn(psw: &mut Input, _, document) {
|
||||||
if let Some(usr) = document.get_element_by_id::<Input>("usr") {
|
if let Some(usr) = document.get_element_by_id::<Input>("usr") {
|
||||||
document.draw(second_screen(usr.text.clone(), psw.text.clone()));
|
document.draw(rsx! {
|
||||||
|
text { static "Username: {}\nPassword: {}", usr.text, psw.text }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, "password: " }
|
}, "password: " }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user