Prefetch all pages on hover for better performance
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user