mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-23 14:29:22 -05:00
🐞 fix: gh-pages mobile page show error
This commit is contained in:
parent
e727d2931f
commit
dc58a03a8b
2 changed files with 11 additions and 3 deletions
|
@ -26,10 +26,10 @@ pub fn App(cx: Scope) -> impl IntoView {
|
||||||
<SliderPage />
|
<SliderPage />
|
||||||
} />
|
} />
|
||||||
<Route path="/tabbar" view=move |cx| view! {cx,
|
<Route path="/tabbar" view=move |cx| view! {cx,
|
||||||
<MobilePage path="/melt-ui/mobile/tabbar" />
|
<MobilePage path="/melt-ui?path=/mobile/tabbar" />
|
||||||
} />
|
} />
|
||||||
<Route path="/nav-bar" view=move |cx| view! {cx,
|
<Route path="/nav-bar" view=move |cx| view! {cx,
|
||||||
<MobilePage path="/melt-ui/mobile/nav-bar" />
|
<MobilePage path="/melt-ui?path=/mobile/nav-bar" />
|
||||||
} />
|
} />
|
||||||
<Route path="/input" view=move |cx| view! {cx,
|
<Route path="/input" view=move |cx| view! {cx,
|
||||||
<InputPage />
|
<InputPage />
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
use leptos::*;
|
use leptos::*;
|
||||||
use leptos_router::use_navigate;
|
use leptos_router::{use_navigate, use_query_map};
|
||||||
use melt_ui::*;
|
use melt_ui::*;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Home(cx: Scope) -> impl IntoView {
|
pub fn Home(cx: Scope) -> impl IntoView {
|
||||||
|
let query_map = use_query_map(cx).get();
|
||||||
|
if let Some(path) = query_map.get("path") {
|
||||||
|
let path = store_value(cx, path.clone());
|
||||||
|
request_animation_frame(move || {
|
||||||
|
let navigate = use_navigate(cx);
|
||||||
|
_ = navigate(&path.get_value(), Default::default());
|
||||||
|
});
|
||||||
|
}
|
||||||
let (theme, set_theme) = create_signal(cx, Theme::light());
|
let (theme, set_theme) = create_signal(cx, Theme::light());
|
||||||
provide_context(cx, theme);
|
provide_context(cx, theme);
|
||||||
let (count, set_count) = create_signal(cx, 0.0);
|
let (count, set_count) = create_signal(cx, 0.0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue