-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking βSign up for GitHubβ, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs-#1020: add nuxt img alt prop definition #1628
Conversation
Deploying nuxt-image with
|
Latest commit: |
a6404b6
|
Status: | β Deploy successful! |
Preview URL: | https://13b61b92.nuxt-image.pages.dev |
Branch Preview URL: | https://docs--1020.nuxt-image.pages.dev |
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #1628 +/- ##
==========================================
+ Coverage 62.83% 62.87% +0.03%
==========================================
Files 79 79
Lines 3536 3539 +3
Branches 411 412 +1
==========================================
+ Hits 2222 2225 +3
Misses 1285 1285
Partials 29 29 β View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<NuxtImg>
accepts all the possible image props, including alt
:
image/src/runtime/components/_base.ts
Lines 31 to 52 in 92a6eee
width: { type: [String, Number], required: false }, | |
height: { type: [String, Number], required: false }, | |
alt: { type: String, required: false }, | |
referrerpolicy: { type: String as unknown as () => ImgHTMLAttributes['referrerpolicy'], required: false }, | |
usemap: { type: String, required: false }, | |
longdesc: { type: String, required: false }, | |
ismap: { type: Boolean, required: false }, | |
loading: { | |
type: String as () => 'lazy' | 'eager', | |
required: false, | |
validator: (val: any) => ['lazy', 'eager'].includes(val), | |
}, | |
crossorigin: { | |
type: [Boolean, String] as unknown as () => 'anonymous' | 'use-credentials' | boolean, | |
required: false, | |
validator: (val: any) => ['anonymous', 'use-credentials', '', true, false].includes(val), | |
}, | |
decoding: { | |
type: String as () => 'async' | 'auto' | 'sync', | |
required: false, | |
validator: (val: any) => ['async', 'auto', 'sync'].includes(val), | |
}, |
I think if we mention it here we should note that <NuxtImg>
does not apply any special handling for alt
but reiterate how important it is to provide it, and include a link to MDN.
Fixed @danielroe Could you check if now it looks good? :) Should I also write the importance of setting this attribute? |
π Linked issue
Resolves #1020
β Type of change
π Description
This PR adds a note in the documentation about the
alt
prop thatNuxtImg
accepts while it is not documented.