From 9b0947866565ef0cec7c0667137a7c60aba17b49 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Tue, 29 Aug 2023 11:09:28 +0800 Subject: [PATCH] fix: untracked --- gh-pages/README.md | 3 +++ gh-pages/Trunk.toml | 2 +- gh-pages/src/pages/home.rs | 8 +++----- src/menu/mod.rs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 gh-pages/README.md diff --git a/gh-pages/README.md b/gh-pages/README.md new file mode 100644 index 0000000..51063f2 --- /dev/null +++ b/gh-pages/README.md @@ -0,0 +1,3 @@ +## Used + +Run the `trunk serve` command and then open the `http://127.0.0.1:6421/melt-ui` URL diff --git a/gh-pages/Trunk.toml b/gh-pages/Trunk.toml index e45af6e..bb3d0da 100644 --- a/gh-pages/Trunk.toml +++ b/gh-pages/Trunk.toml @@ -2,7 +2,7 @@ target = "index.html" public_url = "/melt-ui/" dist = "../docs" -release = true +# release = true [watch] watch = [ diff --git a/gh-pages/src/pages/home.rs b/gh-pages/src/pages/home.rs index 16cd39d..02db9ef 100644 --- a/gh-pages/src/pages/home.rs +++ b/gh-pages/src/pages/home.rs @@ -5,13 +5,11 @@ use melt_ui::*; #[component] pub fn Home() -> impl IntoView { - let query_map = use_query_map().get(); + let query_map = use_query_map().get_untracked(); if let Some(path) = query_map.get("path") { let path = store_value(path.clone()); - request_animation_frame(move || { - let navigate = use_navigate(); - navigate(&path.get_value(), Default::default()); - }); + let navigate = use_navigate(); + navigate(&path.get_value(), Default::default()); } view! { diff --git a/src/menu/mod.rs b/src/menu/mod.rs index d028464..6a3fce2 100644 --- a/src/menu/mod.rs +++ b/src/menu/mod.rs @@ -5,7 +5,7 @@ pub use menu_item::*; #[component] pub fn Menu(#[prop(into)] selected: RwSignal, children: Children) -> impl IntoView { - let menu_injection_key = create_rw_signal(MenuInjectionKey::new(selected.get())); + let menu_injection_key = create_rw_signal(MenuInjectionKey::new(selected.get_untracked())); create_effect(move |_| { let selected_key = selected.get(); let key = menu_injection_key.get_untracked();