Allow Image component to not use async decoding

This commit is contained in:
2022-08-21 11:44:55 +02:00
parent 0f6ab4a63a
commit 2fd2d252ca

View File

@@ -10,6 +10,7 @@
export let ratio: number = undefined
export let alt: string
export let lazy: boolean = true
export let decoding: "auto" | "sync" | "async" = "auto"
interface Sizes {
small?: { width?: number, height?: number }
@@ -78,8 +79,8 @@
srcset={srcSet.jpg.join(', ').trim()}
width={imgWidth}
height={imgHeight}
alt={alt}
{alt}
loading={lazy ? 'lazy' : undefined}
decoding={lazy ? "async" : undefined}
{decoding}
/>
</picture>