直播电商平台开发,vue显示列表中的多张本地照片
注意这里的路径不能使用{{this.id}}这种变量,且要使用require()函数并将路径断开
<div class="booksnew_card" v-for="(item,index) in bookList" :key="item.id">
<router-link :to="{path: '/book',query:{id:item.id}}">
<el-image
style="width: 82%; height: 190px;margin:5px 9%"
:src="require('../assets/books/book'+(index+1)+'.jpg')"
fit="fill"></el-image>
<div style="width: 86%;margin: 0px 7%">
<a href="#" class="booksnew_text">
{{item.name}}
</a>
<div class="booksnew_author">
{{item.author}}
</div>
</div>
</router-link>
</div>
以上就是 直播电商平台开发,vue显示列表中的多张本地照片,更多内容欢迎关注之后的文章