feat: fix the scope rollover bug
This commit is contained in:
1 parent
e4d089fabc
commit
d4b6bb8a7b
17 files changed
+591
-360
No files matched your search
@@ -120,8 +120,11 @@ pub fn Link<'a>(cx: Scope<'a, LinkProps<'a>>) -> Element {
|
||||
prevent_default: "{prevent_default}",
|
||||
target: format_args!("{}", if * new_tab { "_blank" } else { "" }),
|
||||
onclick: move |_| {
|
||||
log::trace!("Clicked link to {}", to);
|
||||
|
||||
if !outerlink {
|
||||
if let Some(service) = svc {
|
||||
log::trace!("Pushing route to {}", to);
|
||||
service.push_route(to, cx.props.title.map(|f| f.to_string()), None);
|
||||
} else {
|
||||
log::error!(
|
||||
|
||||
@@ -45,13 +45,13 @@ pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
|
||||
router_root.register_total_route(route_context.total_route, cx.scope_id());
|
||||
});
|
||||
|
||||
log::trace!("Checking Route: {:?}", cx.props.to);
|
||||
println!("Checking Route: {:?}", cx.props.to);
|
||||
|
||||
if router_root.should_render(cx.scope_id()) {
|
||||
log::trace!("Route should render: {:?}", cx.scope_id());
|
||||
println!("Route should render: {:?}", cx.scope_id());
|
||||
cx.render(rsx!(&cx.props.children))
|
||||
} else {
|
||||
log::trace!("Route should *not* render: {:?}", cx.scope_id());
|
||||
println!("Route should *not* render: {:?}", cx.scope_id());
|
||||
cx.render(rsx!(()))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user