🐞 fix: gh-pages mobile page show error

This commit is contained in:
luoxiao 2023-06-13 13:49:35 +08:00
parent e727d2931f
commit dc58a03a8b
2 changed files with 11 additions and 3 deletions

View file

@ -26,10 +26,10 @@ pub fn App(cx: Scope) -> impl IntoView {
<SliderPage />
} />
<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,
<MobilePage path="/melt-ui/mobile/nav-bar" />
<MobilePage path="/melt-ui?path=/mobile/nav-bar" />
} />
<Route path="/input" view=move |cx| view! {cx,
<InputPage />

View file

@ -1,9 +1,17 @@
use leptos::*;
use leptos_router::use_navigate;
use leptos_router::{use_navigate, use_query_map};
use melt_ui::*;
#[component]
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());
provide_context(cx, theme);
let (count, set_count) = create_signal(cx, 0.0);