Closed joonazan closed 4 years ago
i found a way,
.children(&mut [
NavBar::render(state.navbar.clone()),
html!("div", {
.style("height", "500px")
.children_signal_vec(
Route::signal().map( move |x|
match x {
Route::Index => vec![IndexPage::render(state.index_page.clone())],
Route::Docs => vec![DocsPage::render(state.docs_page.clone())],
Route::Pricing => vec![PricingPage::render(state.pricing_page.clone())],
Route::Signup => vec![
SignupPage::render(state.signup_page.clone()),
html!("div", {
.text("Signup!")
})
]
}
).to_signal_vec()
)
}),
])
@joonazan Whoops, sorry, somehow I missed your message.
I recently added in a child_signal
method, which allows you to attach a single child element (you can return None
to remove the child):
.child_signal(signal_of_elements.map(|x| Some(x)))
I'm currently using
Is there a more efficient way to show a whole tag that comes out of a signal?