image icon indicating copy to clipboard operation
image copied to clipboard

Nuxt Picture class prop override Nuxt Image

Open nthduy opened this issue 3 years ago • 0 comments

Context: I wanted to set a different class for picture tag and img tag using <nuxt-picture>, based on the documentation i can do it using imgAttrs prop like so

<nuxt-picture class="my-picture-class" :imgAttrs="{'class': 'my-img-class'}"  src="awsome.jpg"/>

Expected result

<picture class="my-picture-class">
   <img src="awsome.jpg" class="my-img-class" />
</picture>

Rendered result

<picture class="my-picture-class">
   <img src="awsome.jpg" class="my-picture-class" />
</picture>

I think it is related to this line in nuxt picture component

Reproduction: https://stackblitz.com/edit/nuxt-starter-dtzrru?file=app.vue

nthduy avatar Sep 08 '22 16:09 nthduy