【发布时间】:2021-06-21 23:47:35
【问题描述】:
我在我的应用程序中使用 antd,我正在尝试执行 customRender 以在单元格中显示图像。
我的列数组如下所示:
columns: [
{ title: 'Design',
dataIndex: 'designImage.fileUrl',
customRender () { // h will be injected
return '<div id="foo">bar</div>'
}
},
]
所以,正如你想象的那样,结果是这样的:
我也试过这种方式:
{ title: 'Design',
dataIndex: 'designImage.fileUrl',
customRender: (text, record, index) => {
return {
children: '<img src="https://via.placeholder.com/300.png/09f/fff">'
}
}
},
不幸的是,结果是这样的:
有人可以帮我弄清楚我做错了什么吗?
【问题讨论】: