✨ (pagetop): Mejora API y doc. de Children
- `From<T: Component> for ChildOp: with_child()` acepta componentes directamente sin envolverlos en `Child::with(...)`. - `From<Child> for ChildOp` para completar las conversiones implícitas. - Actualiza ejemplos y tests con la nueva API en bootsier y aliner.
This commit is contained in:
parent
cd9454a729
commit
d10d546418
27 changed files with 346 additions and 313 deletions
|
|
@ -69,10 +69,10 @@ use pagetop_aliner::Aliner;
|
|||
async fn homepage(request: HttpRequest) -> ResultPage<Markup, ErrorPage> {
|
||||
Page::new(request)
|
||||
.with_theme(&Aliner)
|
||||
.add_child(
|
||||
.with_child(
|
||||
Block::new()
|
||||
.with_title(L10n::l("sample_title"))
|
||||
.add_child(Html::with(|cx| html! {
|
||||
.with_child(Html::with(|cx| html! {
|
||||
p { (L10n::l("sample_content").using(cx)) }
|
||||
})),
|
||||
)
|
||||
|
|
@ -122,7 +122,7 @@ impl Theme for Aliner {
|
|||
))
|
||||
.alter_child_in(
|
||||
&DefaultRegion::Footer,
|
||||
ChildOp::AddIfEmpty(Child::with(PoweredBy::new())),
|
||||
ChildOp::AddIfEmpty(PoweredBy::new().into()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue