Files

9 lines
309 B
TypeScript
Raw Permalink Normal View History

/** In-page anchors (`#solutions`) work on the home page; elsewhere they must point back to `/`. */
export function useSectionHref() {
const route = useRoute();
return (href: string) => {
if (!href.startsWith("#") || route.path === "/") return href;
return href === "#" ? "/" : `/${href}`;
};
}