我想在iview table里面添加图片
我的代码(请忽略竖线
)
渲染之后只有img标签,没有src属性
请问这里应该怎么做呀
{
title: '头像', key: 'headimg',
render: (h, params) => {
console.log(params.row)
return h('div', {
attrs: {
style: 'width: 40px;height: 40px;'
},
}, [
h('img', {
props: {
type: 'primary',
size: 'small'
},
attrs: {
src: params.row.headimg, style: 'width: 40px;height: 40px;border-radius: 2px;'
},
style: {
},
}),
]);
}
},
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答4.7k 阅读✓ 已解决
4 回答4.3k 阅读✓ 已解决
4 回答1.9k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
2 回答2.5k 阅读✓ 已解决
应该用
attrs
而不是props
.