简体   繁体   English

获取ant.design Table列中另一列的值?

[英]Get value of another column in an ant.design Table's column?

In my react and ant.design based app, I've a table with the following columns. 在我的react和基于ant.design的应用程序中,我有一个包含以下列的表。

const tableColumns = [{
      title : 'Lorem',
      dataIndex : 'lorem'
      render: text => <a href='#'> {text + ipsum} </a>
    }, {
      title : 'Ipsum',
      dataIndex : 'ipsum'
    }];

I want to use value for ipsum ie the second column for each row inside render function of the first column. 我想使用ipsum值,即第一列的render函数内每行的第二列。 What's the best recommended way in ant.design to fetch second column's value here? ant.design中获取第二列值的最佳推荐方法是什么?

The second argument to the render function is the current record: render函数的第二个参数是当前记录:

render: (text, row) => <a> {text + row.ipsum} </a>

https://ant.design/components/table/#Column https://ant.design/components/table/#Column

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM