【发布时间】:2021-06-04 20:57:40
【问题描述】:
我有这样的json
{
"_id": "603aaab9dead94fee94d280e",
"store_id": "6031a1bde94a31fcbd6af4e5",
"store_name": "maria",
"name": "alpokal",
"description": "test buah mangga",
"unit": "kilogram",
"price": 15000,
"fprice": "Rp 15,000",
"quantity": 1,
"image": [
{
"_id": "603aaabadead94fee94d2810",
"filename": "https://storage.googleapis.com/jsimage/1614457529947-867187617.jpg"
}
]
}
这是我的Vue模板,但是<img>src有错误
<template>
<div>
<div class="row">
<div v-for="item in productAll" :key="item._id" class="col-md-3 col-xs-6">
<div class="card">
<img v-bind:src={{"item.image.[0].filename"}} />
<div class="card-body">
<h5 class="card-title">{{item.name}}</h5>
<p>{{item.description}}</p>
<p>{{item.unit}}</p>
<p>{{item.fprice}}</p>
<p>{{item.quantity}}</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
</div>
</template>
结果不是图像,而是文本 谢谢你
【问题讨论】:
-
试试这个
标签: javascript json image vue.js vue-component