0

I am trying to output value from vue variable within quotation.

<div v-for="product in inventory" class="col">
   <div class="card shadow-sm">
      <div style="background-image: url('images/{{ product.img }}')"
                class="bd-placeholder-img card-img-top"></div>
   </div>
infomasud
  • 2,263
  • 1
  • 18
  • 12
  • 1
    If you want to use a variable in your template, use `v-bind:style` instead. – Terry Oct 08 '22 at 21:17
  • Does this answer your question? [Combining string & variable in element attribute in Vue component template](https://stackoverflow.com/questions/45451858/combining-string-variable-in-element-attribute-in-vue-component-template) – Terry Oct 08 '22 at 21:18
  • Sorry. No really. – infomasud Oct 10 '22 at 15:30
  • There’s a guide in the official docs: https://vuejs.org/guide/essentials/class-and-style.html#binding-inline-styles – Terry Oct 10 '22 at 18:23

0 Answers0