feat: fallback view in router

This commit is contained in:
əlemi 2024-04-15 17:53:54 +02:00
parent 22f5ccf886
commit f733d42af7
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -34,7 +34,14 @@ fn main() {
<hr /> <hr />
</div> </div>
<div class="col-main"> <div class="col-main">
<Router> <Router // TODO maybe set base="/web" ?
fallback=move || view! {
<div class="center">
<h3>nothing to see here!</h3>
<p><a href="/web"><button type="button">back to root</button></a></p>
</div>
}.into_view()
>
<main> <main>
<Routes> <Routes>
<Route path="/" view=move || view! { <Redirect path="/web" /> } /> <Route path="/" view=move || view! { <Redirect path="/web" /> } />