docs: minor fixes for some code examples in the book (#2077)
This commit is contained in:
parent
75c27e0b85
commit
9c44da2594
|
@ -135,17 +135,17 @@ pub fn App() -> impl IntoView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Outer(ChildrenFn) -> impl IntoView {
|
pub fn Outer(children: ChildrenFn) -> impl IntoView {
|
||||||
children()
|
children()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Inner(ChildrenFn) -> impl IntoView {
|
pub fn Inner(children: ChildrenFn) -> impl IntoView {
|
||||||
children()
|
children()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Inmost(ng) -> impl IntoView {
|
pub fn Inmost(name: String) -> impl IntoView {
|
||||||
view! {
|
view! {
|
||||||
<p>{name}</p>
|
<p>{name}</p>
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ pub struct Todos(Vec<Todo>);
|
||||||
|
|
||||||
impl Todos {
|
impl Todos {
|
||||||
pub fn num_remaining(&self) -> usize {
|
pub fn num_remaining(&self) -> usize {
|
||||||
todos.iter().filter(|todo| !todo.completed).sum()
|
self.0.iter().filter(|todo| !todo.completed).sum()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue