♻️ (pagetop): Refactorización de Contextual
Los métodos `required_id()` y `push_message()` son operaciones de tiempo de renderizado, no de construcción. Se trasladan como métodos inherentes de `Context`. También se ajustan los métodos asociados a parámetros.
This commit is contained in:
parent
b3292c32f7
commit
edc809aadd
7 changed files with 121 additions and 189 deletions
|
|
@ -26,7 +26,7 @@ use std::sync::Arc;
|
|||
/// ```rust
|
||||
/// # use pagetop::prelude::*;
|
||||
/// let component = Html::with(|cx| {
|
||||
/// let user = cx.param::<String>("username").cloned().unwrap_or("visitor".to_string());
|
||||
/// let user = cx.param_or("username", "visitor".to_string());
|
||||
/// html! {
|
||||
/// h1 { "Hello, " (user) }
|
||||
/// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue