I'm a beginner in vue.js . I've create a Vue component "cards" that has some Vue componet "card" . I have an error in :src="{ card.imgSource }" . I don't know what should I do to solve it . Please help me .
Vue.component('cards' , {
props: ['cards'],
template : `
<div class="row products">
<card v-for="(card , index) in cards" :card="card" :index="index"></card>
</div>
`
});
Vue.component('card' , {
props :['card' , 'index'],
template : `
<div class="col-md-4 product">
<div class="card">
<img :src="{ card.imgSource }" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{ card.title }}</h5>
<p class="card-text">{{ card.body }}</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
`
});
let imgs = "img/shoe_img.jpg";
let app = new Vue({
el : '#app',
data : {
cards : [
{ title : 'Product 1' , body : "Some quick example text to build on the card title and make up the bulk of the card's content." ,imgSource : imgs },
{ title : 'Product 2' , body : "Some quick example text to build on the card title and make up the bulk of the card's content." ,imgSource: imgs},
{ title : 'Product 3' , body : "Some quick example text to build on the card title and make up the bulk of the card's content." ,imgSource: imgs}
],
alert : {
title : '',
message : '',
show : false ,
type : ''
}
},
});