javascript - 是否可以将图像添加到 Ant Design Tables 中的单元格表?

标签 javascript reactjs user-interface frontend ant-design-pro

我正在尝试创建一个列,在他的条目中将包含一张小图片和一个名称。 我怎样才能使用 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,然后将其与altsrc 一起使用。

关于javascript - 是否可以将图像添加到 Ant Design Tables 中的单元格表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53291138/

相关文章:

javascript - Xpath获取所有带有内部文本的链接

javascript - 基本 Angular 形式验证不起作用

javascript - React - Babel 不转译文件

reactjs - 在 react 应用程序中拦截返回事件以确认保存

c++ - Qt:如何将 GUI 元素的集合放入独立的子类中(使用单独的 *.ui 文件)

javascript - 类型错误 : Cannot read property 'ref' of undefined Firebase-storage react

javascript - 如何触发延迟到用户暂停输入的 onkeyup 事件?

javascript - 确切地说,在未安装的组件上发生 React 状态更新警告?

css - 使用 CSS2/3、mixins 和绘图 API/HTML5 canvas 的 OpenLaszlo 现代组件集

user-interface - 我应该学习什么语言来创建命令行脚本和 GUI?