vue 多图字段显示
一张图片
<el-table-column label="头像">
<template slot-scope="scope">
<img :src="scope.row.img" width="40" height="40" class="head_pic"/>
</template>
</el-table-column>
对象多张图片
<el-table-column prop="pictures" label="描述图片">
<template scope="scope">
<img v-for="item in scope.row.pictures" :src="item" width="40" height="40" class="head_pic"/>
</template>
</el-table-column>
字符串多张图片
methods:
methods: {
// 切割imageUrl
imageUrlCut(imageUrl){
let url=imageUrl.split(",")
return url
},
template:
<el-table-column prop="imageUrl" label="描述图片">
<template scope="scope">
<img v-for="item in imageUrlCut(scope.row.imageUrl)" :src="item" style="height: 80px"/>
</template>
</el-table-column>