VUE cli3 脚手架循环展示多张图片
<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...
·
<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;
},
效果:
更多推荐
已为社区贡献2条内容
所有评论(0)