nuxt-img + vanilla-lazyload
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 331
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 9
Description
ERROR 1
Using <img tag it works. Using <nuxt-img tag instead, it doesn't work.
error: 500. Input must be a string (received undefined: undefined)
- with module v. 0.7 it works (for Nuxt v.2).
- with this version 1.x (for Nuxt v.3) it does not work because the module must have the
srcparameter already set. If in fact I use a combination ofsrc+data-srcthe module works. However, in this way, I have to call two images.
Reproduction: https://stackblitz.com/edit/github-uv7ped?file=components/myimg.vue
ERROR 2
(related to the first ): <nuxt-picture with class="lazy" doen't work.
This works
<nuxt-img
src="/images/1x1.png"
:data-src="src"
class="lazy shadow-md"
/>
This not
<figure>
<nuxt-picture
src="/images/1x1.png"
:data-src="src"
:imgAttrs="{class:'lazy shadow-md w-full h-auto'}"
/>
<div class="flex justify-center">
<figcaption class="textdida">
<span>{{textdida }}</span>
</figcaption>
</div>
</figure>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction, especially components/myimg.vue, and compare the working nuxt-img example with the failing nuxt-img and nuxt-picture cases. Trace how src, data-src, and imgAttrs are passed to the components; done means lazy loading works without requiring a duplicate image source and both reported errors are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxtjs, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100