Vue+elementUi+table 中显示图片

话不多说,先看效果

下面是Vue代码

   <el-table-column label="识别照片" :formatter="formatter1">
                <template scope="scope">
                    <img :src="scope.row.img" width="40px" height="40px" />
                </template>
            </el-table-column>

接下来是JS代码

<script>
export default {
    data() {
        return {
            tableData: [{
                id: '1',
                address: '十五栋楼下消防栓',
                tag: '未处理',
                remarks: '在漏水,请尽快解决',
                img: 'https://bkimg.cdn.bcebos.com/pic/1e30e924b899a9016d4692101d950a7b0208f5a1?x-bce-process=image/resize,m_lfit,w_440,limit_1'
            }, {
                id: '3',
                address: '十五栋楼下消防栓',
                tag: '未处理',
                remarks: '在漏水,请尽快解决',
                img: 'https://bkimg.cdn.bcebos.com/pic/1e30e924b899a9016d4692101d950a7b0208f5a1?x-bce-process=image/resize,m_lfit,w_440,limit_1'
            }, ]
        }
    },
    methods: {
        formatter1(row, column) {
            return row.img;
        }
    }
}
</script>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值