When Im binding my image source it can't find the image
<template>
<div class="card">
<img class="card-img-top" :src="this.offer.resource">
<div class="card-body text-center">
<h1>{{offer.name}}</h1>
<p>{{offer.description}}</p>
<h2>{{offer.price}}€</h2>
</div>
</div>
</template>
<script>
import Offer from '@/models/Offer.js'
export default {
props: { offer: Offer},
created: function() {
console.log(this.offer.resource);
}
}
</script>
I get the error: offer_pizza.jpg:1 GET http://localhost:3000/@/assets/images/offer_pizza.jpg 404 (Not Found)
the console.log
prints out the correct path: @/assets/images/offer_pizza.jpg
Howerever when I just hardcode it like this:
<img class="card-img-top" src="@/assets/images/offer_pizza.jpg" >
it works fine.