我正在尝试创建一个列,在他的条目中将包含一张小图片和一个名称。 我怎样才能使用 Ant Design 的表格来做到这一点?
https://ant.design/components/table/ 我似乎无法在文档或示例中找到任何相关内容。
最佳答案
接受的答案中有一个错误,这里是你如何做的
{
title: "Image",
dataIndex: "ImageURL", // this is the value that is parsed from the DB / server side
render: theImageURL => <img alt={theImageURL} src={theImageURL} /> // 'theImageURL' is the variable you must declare in order the render the URL
}
您需要声明theImageURL
,然后将其与alt
和src
一起使用。
关于javascript - 是否可以将图像添加到 Ant Design Tables 中的单元格表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53291138/