fix: untracked

This commit is contained in:
luoxiao 2023-08-29 11:09:28 +08:00
parent 3a1cb72937
commit 9b09478665
4 changed files with 8 additions and 7 deletions

3
gh-pages/README.md Normal file
View file

@ -0,0 +1,3 @@
## Used
Run the `trunk serve` command and then open the `http://127.0.0.1:6421/melt-ui` URL

View file

@ -2,7 +2,7 @@
target = "index.html"
public_url = "/melt-ui/"
dist = "../docs"
release = true
# release = true
[watch]
watch = [

View file

@ -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());
});
}
view! {
<Layout position=LayoutPosition::ABSOLUTE>

View file

@ -5,7 +5,7 @@ pub use menu_item::*;
#[component]
pub fn Menu(#[prop(into)] selected: RwSignal<String>, 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();