Prefetch all pages on hover for better performance

This commit is contained in:
2025-11-17 10:10:34 +01:00
parent 71260199a1
commit 387c3be93a
4 changed files with 14 additions and 11 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ const page = usePage();
<SidebarMenuItem :key="'dashboard'">
<SidebarMenuButton as-child :is-active="urlIsActive(dashboard(), page.url)" :tooltip="'Dashboard'">
<Link :href="dashboard()">
<Link prefetch :href="dashboard()">
<component :is="LayoutGrid" class="text-gray-500" stroke-width="1.5" />
<span>Dashboard</span>
</Link>
@@ -38,13 +38,13 @@ const page = usePage();
<SidebarMenu>
<SidebarMenuItem v-for="item in group.items" :key="item.title">
<SidebarMenuButton as-child :is-active="urlIsActive(item.href, page.url)" :tooltip="item.title">
<Link :href="item.href">
<Link prefetch :href="item.href">
<component :is="item.icon" :class="item.color" stroke-width="1.5" />
<span>{{ item.title }}</span>
</Link>
</SidebarMenuButton>
<SidebarMenuAction v-if="item.action">
<Link :href="item.action.href">
<Link prefetch :href="item.action.href">
<component :is="item.action.icon" :class="item.action.color" stroke-width="1.5" size="0.833rem" />
<span class="sr-only">{{ item.action.title }}</span>
</Link>