我正在尝试引用要在视图中显示的图像,但我无法正确处理。这是我得到的错误:"InvalidCharacterError:无法对‘Element’执行'setAttribute‘:'product.images.filename’不是有效的属性名。“
请协助引用image2路径中的图片,以下是我的代码:
<div v-for="product in Products.data" :key="product.id" class="p-2">
<div class="item p-2">{{product.id}}</div>
<div class="item p-2">{{product.id}} Price:{{product.price}} </div>
<div class="item p-2"><p>Loc:{{product.id}}</p></div>
<div class="item p-2"><p>fff:{{product.images[0].filename}}</p></div>
<img v-bind:src="'images2/'"+product.images[0].filename>
<div class="item p-2"> <a class="btn btn-primary btn-sm" :href="'/products/'+product.id">View</a>
</div>
</div> 我的问题是这行
<img v-bind:src="'images2/'"+product.images[0].filename>发布于 2021-01-29 12:30:59
<img :src="'images2/'+product.images[0].filename"> https://stackoverflow.com/questions/65948513
复制相似问题