Add sveltekit:prefetch on internal links

This commit is contained in:
2021-10-10 14:06:43 +02:00
parent 121c325f99
commit e1f988d4b1
2 changed files with 2 additions and 2 deletions

View File

@@ -16,7 +16,7 @@
{text} {text}
</button> </button>
{:else if tag === 'a'} {:else if tag === 'a'}
<a href={url} class={classes} on:click> <a href={url} class={classes} on:click sveltekit:prefetch>
<slot /> <slot />
<span>{text}</span> <span>{text}</span>
</a> </a>

View File

@@ -37,7 +37,7 @@
<ul> <ul>
{#each links as { icon, alt, url, text }} {#each links as { icon, alt, url, text }}
<li> <li>
<a href={url} on:click={toggleSwitcher} sveltekit:prefetch sveltekit:noscroll> <a href={url} on:click={toggleSwitcher} sveltekit:prefetch>
<img src="/images/icons/{icon}.svg" alt={alt} class="icon" width="32" height="32" loading="lazy"> <img src="/images/icons/{icon}.svg" alt={alt} class="icon" width="32" height="32" loading="lazy">
<span>{text}</span> <span>{text}</span>
</a> </a>