0

I'm creating a movie DB app with vue and I'm trying to output an image source that is being fetched from an API. For some reason the output of the src is not being rendered as it should in the app. It prints the string {{movie.Poster}}. I'm obviously not using v-bind in the right way. So any ideas on how I would print the path to the poster in the right way?

<template>
  <div class="my-10">
    <h2 class="text-bold">{{ movie.Title }}</h2>
    <img v-bind:src="'{{movie.Poster}}'"/>
  </div>
</template>
Oskar Mikael
  • 153
  • 3
  • 17

1 Answers1

1

You need to use

<img :src="movie.Poster"/>

because {{ .. }} is template literals. So it output a string.

Bulent
  • 3,307
  • 1
  • 14
  • 22