Skip to content

Commit

Permalink
feat: add fetch priority to image
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ngo committed Apr 9, 2024
1 parent cc1129b commit a76b650
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export class DeguImage extends LitElement {
@property({type: Number, attribute: 'max-dpr'})
private maxDpr: number = window.devicePixelRatio;

@property({type: String, attribute: 'fetch-priority'})
private fetchPriority: string;

@property() autoRenderWidth = 0;

/**
Expand Down Expand Up @@ -170,8 +173,9 @@ export class DeguImage extends LitElement {

private renderImage(src: string) {
return html`
<img
<img
loading="${this.loading}"
fetchPriority=${ifDefined(this.fetchPriority ? this.fetchPriority : null)}
width=${ifDefined(this.aspectRatioWidth ? this.aspectRatioWidth : null)}
height=${ifDefined(
this.aspectRatioHeight ? this.aspectRatioHeight : null
Expand Down

0 comments on commit a76b650

Please sign in to comment.