<el-table-column label="礼品图片" align="center">
<template slot-scope="scope" >
<div v-for="item in getImg(scope.row.picture)">
<img style="height: 80px" :src="item">
</div>
</template>
</el-table-column>
methods:
getImg(val){
//逗号分隔,后台传来的是逗号拼接的字符串图片路径
var words = val.split(',');
console.log(words)
return words;
},
效果:

本文介绍了一种使用Element UI表格组件展示多个礼品图片的方法,通过解析后台传来的逗号分隔的图片路径字符串,并利用Vue.js的v-for指令循环显示每个图片。
645





