Allow Image component to not use async decoding
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
export let ratio: number = undefined
|
export let ratio: number = undefined
|
||||||
export let alt: string
|
export let alt: string
|
||||||
export let lazy: boolean = true
|
export let lazy: boolean = true
|
||||||
|
export let decoding: "auto" | "sync" | "async" = "auto"
|
||||||
|
|
||||||
interface Sizes {
|
interface Sizes {
|
||||||
small?: { width?: number, height?: number }
|
small?: { width?: number, height?: number }
|
||||||
@@ -78,8 +79,8 @@
|
|||||||
srcset={srcSet.jpg.join(', ').trim()}
|
srcset={srcSet.jpg.join(', ').trim()}
|
||||||
width={imgWidth}
|
width={imgWidth}
|
||||||
height={imgHeight}
|
height={imgHeight}
|
||||||
alt={alt}
|
{alt}
|
||||||
loading={lazy ? 'lazy' : undefined}
|
loading={lazy ? 'lazy' : undefined}
|
||||||
decoding={lazy ? "async" : undefined}
|
{decoding}
|
||||||
/>
|
/>
|
||||||
</picture>
|
</picture>
|
||||||
Reference in New Issue
Block a user