Я учусь реагировать так же, как и дизайн муравьев. Я должен преобразовать некоторый код реагирующей таблицы в таблицу дизайна ant. Вот мой код реакции ниже. Как я могу преобразовать это в дизайн муравья? Пожалуйста, сообщите.
getTableColumns(){
return[
Header: "A",
accessor: "A",
getProps: (state, rowInfo) => ({
style: {
backgroundColor: (rowInfo && rowInfo.original.useCase === Detail.notDefined ? 'red' : null)
}
}),
width: 100
},
//here I have tried to convert it in ant design, but it is not working
{
title: "B",
dataIndex: "B",
key: "B",
render: (d) => {
if (Array.isArray(this.getB(d))) return this.getB(d).join(",")
else return JSON.stringify(this.getB(d))
}
}
{
title: "Edit",
dataIndex: "edit",
key:'edit',
render: (text, record) =>
console.log(record.original),
<a href={`${getApi}/${record.original.parent}/task/${record.original.id}/edit`} target="_blank" rel="noopener noreferrer">Edit</a>,
width: 60
}
]
и мой antd table
сформирован как показано ниже:
<div className="article_full">
<h2>DETAILS</h2>
<Table
rowKey={row => `${row.id}`}
columns={this.getTableColumns()}
dataSource={items}
onChange={this.filter}
Pagination
onChange={this.onPageChange}
total={50}
/>
</div>