mirror of
https://github.com/leptos-rs/leptos
synced 2024-09-20 22:41:59 +00:00
Small changes to examples
This commit is contained in:
parent
7ca131c5b8
commit
2f218e7428
3 changed files with 18 additions and 20 deletions
|
@ -151,10 +151,8 @@ fn Story(cx: Scope, story: api::Story) -> impl IntoView {
|
|||
}}
|
||||
</span>
|
||||
{(story.story_type != "link").then(|| view! { cx,
|
||||
<span>
|
||||
//{" "}
|
||||
<span class="label">{story.story_type}</span>
|
||||
</span>
|
||||
" "
|
||||
<span class="label">{story.story_type}</span>
|
||||
})}
|
||||
</li>
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ pub fn Story(cx: Scope) -> impl IntoView {
|
|||
let meta_description = move || story.read().and_then(|story| story.map(|story| story.title.clone())).unwrap_or_else(|| "Loading story...".to_string());
|
||||
|
||||
view! { cx,
|
||||
<div>
|
||||
<>
|
||||
<Meta name="description" content=meta_description/>
|
||||
{move || story.read().map(|story| match story {
|
||||
None => view! { cx, <div class="item-view">"Error loading this story."</div> },
|
||||
|
@ -58,7 +58,7 @@ pub fn Story(cx: Scope) -> impl IntoView {
|
|||
</div>
|
||||
</div>
|
||||
}})}
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,20 +92,20 @@ pub fn TodoApp(cx: Scope) -> impl IntoView {
|
|||
view! {
|
||||
cx,
|
||||
<div>
|
||||
<Stylesheet href="/style.css"/>
|
||||
<Router>
|
||||
<header>
|
||||
<h1>"My Tasks"</h1>
|
||||
</header>
|
||||
<main>
|
||||
<Routes>
|
||||
<Route path="" element=|cx| view! {
|
||||
cx,
|
||||
<Todos/>
|
||||
}/>
|
||||
</Routes>
|
||||
</main>
|
||||
</Router>
|
||||
<Stylesheet href="/style.css"/>
|
||||
<Router>
|
||||
<header>
|
||||
<h1>"My Tasks"</h1>
|
||||
</header>
|
||||
<main>
|
||||
<Routes>
|
||||
<Route path="" element=|cx| view! {
|
||||
cx,
|
||||
<Todos/>
|
||||
}/>
|
||||
</Routes>
|
||||
</main>
|
||||
</Router>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue