Añade la función arc() para capturar el componente
Recibe un componente mutable que podría modificarse justo antes de ser añadido a un contenedor. Es una posible solución para poder desarrollar un mecanismo aceptable de Triggers/Hooks/Actions (THA) para PageTop.
This commit is contained in:
parent
69139f2a62
commit
53dd1f24c7
14 changed files with 50 additions and 36 deletions
|
|
@ -31,7 +31,7 @@ impl ModuleTrait for UserModule {
|
|||
}
|
||||
}
|
||||
|
||||
fn form_login() -> impl PageComponent {
|
||||
fn form_login() -> ArcComponent {
|
||||
Form::new()
|
||||
.with_id("user-login")
|
||||
.add(form::Input::textfield()
|
||||
|
|
@ -41,13 +41,16 @@ fn form_login() -> impl PageComponent {
|
|||
"app" => SETTINGS.app.name.to_owned()
|
||||
]).as_str())
|
||||
.with_autofocus(true)
|
||||
.arc()
|
||||
)
|
||||
.add(form::Input::password()
|
||||
.with_name("pass")
|
||||
.with_label(l("password").as_str())
|
||||
.with_help_text(l("password_help").as_str())
|
||||
.arc()
|
||||
)
|
||||
.add(form::Button::submit(l("login").as_str()))
|
||||
.add(form::Button::submit(l("login").as_str()).arc())
|
||||
.arc()
|
||||
}
|
||||
|
||||
async fn login() -> app::Result<Markup> {
|
||||
|
|
@ -58,6 +61,7 @@ async fn login() -> app::Result<Markup> {
|
|||
.add_to("content", Container::new()
|
||||
.with_id("welcome")
|
||||
.add(form_login())
|
||||
.arc()
|
||||
)
|
||||
.render()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue