mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-22 16:49:22 -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]
|
||||
fn Demo() -> impl IntoView {
|
||||
if let Some(cookie) = use_cookie("auth") {
|
||||
view! {
|
||||
<div>
|
||||
format!("'auth' cookie set to `{}`", cookie.value())
|
||||
</div>
|
||||
}.into_view()
|
||||
view! { <div>"'auth' cookie set to " <code>"`" {cookie.value().to_string()} "`"</code></div> }
|
||||
.into_view()
|
||||
} else {
|
||||
view! {
|
||||
<div>
|
||||
"No 'auth' cookie set"
|
||||
</div>
|
||||
}.into_view()
|
||||
view! { <div>"No 'auth' cookie set"</div> }
|
||||
.into_view()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue