Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Baroshem
Copy link
Collaborator

πŸ”— Linked issue

Resolves #1020

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds a note in the documentation about the alt prop that NuxtImg accepts while it is not documented.

@Baroshem Baroshem requested a review from danielroe as a code owner December 11, 2024 11:43
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2024

Deploying nuxt-image with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: a6404b6
Status:Β βœ…Β  Deploy successful!
Preview URL: https://13b61b92.nuxt-image.pages.dev
Branch Preview URL: https://docs--1020.nuxt-image.pages.dev

View logs

@Baroshem Baroshem self-assigned this Dec 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 62.87%. Comparing base (06f7f77) to head (a6404b6).
Report is 6 commits behind head on main.

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.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Member

@danielroe danielroe left a 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:

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.

@Baroshem
Copy link
Collaborator Author

Baroshem commented Dec 20, 2024

Fixed @danielroe

Could you check if now it looks good? :)

Should I also write the importance of setting this attribute?

@danielroe danielroe merged commit 362eca3 into main Dec 20, 2024
3 checks passed
@danielroe danielroe deleted the docs/#1020 branch December 20, 2024 11:10
@github-actions github-actions bot mentioned this pull request Dec 20, 2024
@github-actions github-actions bot mentioned this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alt props into documentation

4 participants