0

I'm building a website using Gridsome. My website has a lot of components which I then use the g-image tag.

Based on the doc, "The src attribute and options like width, height and quality must be static values because they are compiled into an object which contains URLs and other information that will be rendered into an img tag." From my understanding I can't use the tag like this (I can but it won't the benefit of using the tag):

<g-image :src="image.url" :alt="image.alt" height="100" width="100"></g-image>

Am I understanding it right? If I am I think there's very limited situation where you can use the tag, especially when most people have some sort of CMS system. What's your thought and what's your alternative?

Tanpo
  • 233
  • 3
  • 18

1 Answers1

1

Can't you just do <g-image :src="image.url" :alt="image.alt" style="height: 100px;width: 100px;"></g-image>?

sno2
  • 3,274
  • 11
  • 37
  • 1
    yep, you can. i figured this out a while ago. Just have to make sure the image.url is an absolute path to the image file. thanks! – Tanpo Jun 23 '20 at 12:55