实现效果:
代码:
接口获取到的图片src push到一个数组里,然后v-for循环出来
<!-- 墓碑照片 -->
<el-table-column label="墓碑照片" align="center" prop="photo" width="155px">
<template slot-scope="scope">
<!-- <img v-for="item in scope.row.photo" :src="item" :key="item.id"
style="width: 40px; height: 40px; margin-right: 5px" /> -->
<span v-for="(item, index) in scope.row.photo" :key="index">
<el-popover placement="right" width="300" trigger="hover">
<img :src="item" width="300px" height="300px">
<img slot="reference" :src="item" style="width: 60px; height: 60px; margin-right: 5px">
</el-popover>
</span>
</template>
</el-table-column>