mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-23 06:19:22 -05:00
✨ feat(example): just page
This commit is contained in:
parent
ae9a39c81f
commit
d61fa318c5
1 changed files with 8 additions and 1 deletions
|
@ -3,6 +3,7 @@ use crate::demo_checkbox::*;
|
||||||
use crate::demo_modal::*;
|
use crate::demo_modal::*;
|
||||||
use crate::demo_slider::*;
|
use crate::demo_slider::*;
|
||||||
use leptos::*;
|
use leptos::*;
|
||||||
|
use leptos_router::use_navigate;
|
||||||
use melt_ui::*;
|
use melt_ui::*;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
|
@ -13,13 +14,19 @@ pub fn Home(cx: Scope) -> impl IntoView {
|
||||||
let (button_type, set_button_type) = create_signal(cx, ButtonType::TEXT);
|
let (button_type, set_button_type) = create_signal(cx, ButtonType::TEXT);
|
||||||
|
|
||||||
let count_string = create_memo(cx, move |_| {
|
let count_string = create_memo(cx, move |_| {
|
||||||
log!("sd");
|
|
||||||
count.get().to_string()
|
count.get().to_string()
|
||||||
});
|
});
|
||||||
let on_input = SignalSetter::map(cx, move |value: String| {
|
let on_input = SignalSetter::map(cx, move |value: String| {
|
||||||
set_count.set(value.parse().unwrap());
|
set_count.set(value.parse().unwrap());
|
||||||
});
|
});
|
||||||
view! { cx,
|
view! { cx,
|
||||||
|
<Button on:click=move |_| {
|
||||||
|
let navigate = use_navigate(cx);
|
||||||
|
_ = navigate("/components/menu", Default::default());
|
||||||
|
}>
|
||||||
|
"components"
|
||||||
|
</Button>
|
||||||
|
<hr />
|
||||||
<Space>
|
<Space>
|
||||||
<Input value=count_string on_input=on_input/>
|
<Input value=count_string on_input=on_input/>
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Add table
Reference in a new issue