docs: add preload example for NuxtImg#2124
Conversation
Added example for passing an object to the preload prop to define fetch priority.
commit: |
📝 WalkthroughWalkthroughDocumentation for the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2124 +/- ##
=====================================
Coverage 6.83% 6.83%
=====================================
Files 80 80
Lines 3729 3729
Branches 142 142
=====================================
Hits 255 255
Misses 3424 3424
Partials 50 50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/content/2.usage/1.nuxt-img.md`:
- Line 371: Update the prose to use the camelCase key name "fetchPriority" to
match the JS object example for the preload prop (mentioning the preload prop
and the object key fetchPriority), and append a brief note listing the valid
values ("auto", "high", "low") so readers see the full set of options.
- Around line 371-375: Update the docs example and prose to state that the
preload.fetchPriority accepts three values—'auto', 'high', and 'low'—not just
'high', and update the example to show one or more of these values; also clarify
that the JS property is camelCase fetchPriority (as defined in BaseImageProps)
but becomes the lowercase HTML attribute fetchpriority on the generated preload
link (handled in NuxtImg component), so readers understand the mapping.
Added example for passing an object to the preload prop to define fetch priority.
🔗 Linked issue
related to nuxt/nuxt.com#2061
❓ Type of change
📚 Description
Document preload options.
From this other PR, I learned preload could take an object as a prop, but it's not documented on the site. This PR adds this information.
nuxt/nuxt#34341