🚧 [context] Generaliza los parámetros de contexto
This commit is contained in:
parent
8274519405
commit
3bf058b8a5
4 changed files with 168 additions and 38 deletions
|
@ -25,7 +25,7 @@ use crate::prelude::*;
|
|||
/// use pagetop::prelude::*;
|
||||
///
|
||||
/// let component = Html::with(|cx| {
|
||||
/// let user = cx.get_param::<String>("username").unwrap_or(String::from("visitor"));
|
||||
/// let user = cx.param::<String>("username").cloned().unwrap_or(String::from("visitor"));
|
||||
/// html! {
|
||||
/// h1 { "Hello, " (user) }
|
||||
/// }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue