Skip to content

Commit eb4f5d0

Browse files
docs: add preload example for NuxtImg (#2124)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 2c22030 commit eb4f5d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/content/2.usage/1.nuxt-img.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@ In case you want to preload the image, use this prop. This will place a correspo
368368
<NuxtImg src="/nuxt-icon.png" preload />
369369
```
370370

371+
Passing an object to the preload prop lets you define the `fetchPriority` property.
372+
Note that the JavaScript property `fetchPriority` maps to the [`fetchpriority`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/fetchpriority) HTML attribute in the preload link tag.
373+
Accepted values are `auto`, `high`, or `low`.
374+
375+
```vue
376+
<NuxtImg src="/nuxt-icon.png" :preload="{ fetchPriority: 'high' }" />
377+
```
378+
371379
### `loading`
372380

373381
This is a [native](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading) attribute that provides a hint

0 commit comments

Comments
 (0)