<template>
<div>
<Table
:columns="columns"
:data="data"
stripe
></Table>
</div>
</template>
<script>
export default {
data() {
return {
data: [
{
id: 1,
img: 'https://dev-file.iviewui.com/YSlcnG8cnT6zMRGskMn4F5E0sghiFB9w/large'
},
{
id: 2,
img: 'https://dev-file.iviewui.com/hqegWf0w32KCIveKIafRU3ZmYfXugsI8/large'
}
],
columns: [
{
title: 'ID',
key: 'id'
},
{
title: '图片',
key: 'img',
render: (h, params) => {
return h('img', {
attrs: {
src: params.row.img
},
style: {
width: '200px'
}
})
}
}
]
}
}
}
</script>
[iview]Table中展示图片
最新推荐文章于 2023-08-05 17:14:37 发布