image icon indicating copy to clipboard operation
image copied to clipboard

Placeholder slot for `<NuxtImg>`

Open DamianGlowala opened this issue 1 year ago • 2 comments

I've been thinking of how to achieve more sophisticated placeholders using <NuxtImg> than what the placeholder prop allows for. Being able to define the placeholder in a slot would allow for greater flexibility:

<NuxtImg>
  <template #placeholder>
    <SkeletonLoader />
  </template>
</NuxtImg>

If this is a desirable addition, I am willing to implement it.

DamianGlowala avatar Mar 30 '24 09:03 DamianGlowala

That would be great, dealing with placeholder could be improved !!

damevin avatar Jul 14 '24 15:07 damevin

yes please 😀

KingSit3 avatar Aug 13 '24 10:08 KingSit3

@DamianGlowala I think this is an awesome idea! Please if you have time, create a PR with the implementation proposal :)

Baroshem avatar Dec 09 '24 13:12 Baroshem

I made a PR, but there are some tests failing. Can you check it please @DamianGlowala? This is officially my first contribution so I will be happy if someone checks it out.

danekslama avatar Dec 10 '24 08:12 danekslama

@Baroshem I have fixed the tests, added examples, and addressed your suggestions. Everything seems to be working now.

danekslama avatar Dec 13 '24 18:12 danekslama