mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
docs: updated error handling code (#610)
code is from already updated example
This commit is contained in:
parent
dd0bcb950a
commit
cebc824fbe
1 changed files with 2 additions and 4 deletions
|
@ -63,7 +63,7 @@ Let’s add an `<ErrorBoundary/>` to this example.
|
|||
fn NumericInput(cx: Scope) -> impl IntoView {
|
||||
let (value, set_value) = create_signal(cx, Ok(0));
|
||||
|
||||
let on_input = move |ev| set_value(event_target_value(&ev).parse::<i32>());
|
||||
let on_input = move |ev| set_value(event_target_value(&ev).parse::<i32>());
|
||||
|
||||
view! { cx,
|
||||
<h1>"Error Handling"</h1>
|
||||
|
@ -77,9 +77,7 @@ let on_input = move |ev| set_value(event_target_value(&ev).parse::<i32>());
|
|||
<p>"Not a number! Errors: "</p>
|
||||
// we can render a list of errors as strings, if we'd like
|
||||
<ul>
|
||||
{move || errors.unwrap()
|
||||
.get()
|
||||
.0
|
||||
{move || errors.get()
|
||||
.into_iter()
|
||||
.map(|(_, e)| view! { cx, <li>{e.to_string()}</li>})
|
||||
.collect::<Vec<_>>()
|
||||
|
|
Loading…
Reference in a new issue