mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 09:09:21 -05:00
fixed use_cookie example
This commit is contained in:
parent
4598c27e29
commit
91071cf119
1 changed files with 4 additions and 10 deletions
|
@ -5,17 +5,11 @@ use leptos_use::use_cookie;
|
||||||
#[component]
|
#[component]
|
||||||
fn Demo() -> impl IntoView {
|
fn Demo() -> impl IntoView {
|
||||||
if let Some(cookie) = use_cookie("auth") {
|
if let Some(cookie) = use_cookie("auth") {
|
||||||
view! {
|
view! { <div>"'auth' cookie set to " <code>"`" {cookie.value().to_string()} "`"</code></div> }
|
||||||
<div>
|
.into_view()
|
||||||
format!("'auth' cookie set to `{}`", cookie.value())
|
|
||||||
</div>
|
|
||||||
}.into_view()
|
|
||||||
} else {
|
} else {
|
||||||
view! {
|
view! { <div>"No 'auth' cookie set"</div> }
|
||||||
<div>
|
.into_view()
|
||||||
"No 'auth' cookie set"
|
|
||||||
</div>
|
|
||||||
}.into_view()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue