mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
✨ feat(example): add slider page
This commit is contained in:
parent
8efe55780d
commit
571191fb4f
3 changed files with 18 additions and 0 deletions
|
@ -10,6 +10,9 @@ pub fn App(cx: Scope) -> impl IntoView {
|
|||
<Route path="/" view=move |cx| view! {cx,
|
||||
<Home />
|
||||
} />
|
||||
<Route path="/slider" view=move |cx| view! {cx,
|
||||
<SliderPage />
|
||||
} />
|
||||
</Routes>
|
||||
</Router>
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
mod home;
|
||||
mod slider;
|
||||
|
||||
pub use home::*;
|
||||
pub use slider::*;
|
13
examples/basic/src/pages/slider/mod.rs
Normal file
13
examples/basic/src/pages/slider/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
use leptos::*;
|
||||
use melt_ui::*;
|
||||
|
||||
#[component]
|
||||
pub fn SliderPage(cx: Scope) -> impl IntoView {
|
||||
let (value, set_value) = create_signal(cx, 0.0);
|
||||
let on_value = SignalSetter::map(cx, move |value| {
|
||||
set_value.set(value);
|
||||
});
|
||||
view! { cx,
|
||||
<Slider value=value on_value=on_value/>
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue