Skip to content
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

nuxt-img + vanilla-lazyload #741

Open
giticon opened this issue Feb 8, 2023 · 2 comments
Open

nuxt-img + vanilla-lazyload #741

giticon opened this issue Feb 8, 2023 · 2 comments
Labels

Comments

@giticon
Copy link

giticon commented Feb 8, 2023

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)

  1. with module v. 0.7 it works (for Nuxt v.2).
  2. with this version 1.x (for Nuxt v.3) it does not work because the module must have the src parameter already set. If in fact I use a combination of src + data-src the 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>
@benjamin-ott
Copy link

The same thing also happens with other lazy loading modules, e.g. lozad.

@hrishikesh-k
Copy link

I tried to generate a custom image component to solve this issue, but that has a different problem: #820

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants