在iview中显示图片只用到js中对应columns1列下设置即可代码如下
{
title: '图片',
key: 'cover',
render: (h, params) => {
return h('div', {
attrs: {
style: 'width: 40px;height: 40px;'
},
}, [
h('img', {
props: {
type: 'primary',
size: 'small'
},
attrs: {
src: params.row.cover, style: 'width: 40px;height: 40px;border-radius: 2px;'
},
style: {
},
}),
]);
}
},