【发布时间】:2021-10-10 04:06:58
【问题描述】:
我有一个 Antd Table,数据来自 axios API
"data": [
{
"id": 1,
"name": "Package 1",
"services": [
{
"id": 1,
"name": "Evaluation Core",
}
]
},
{
"id": 2,
"name": "Package 2",
"services": [
{
"id": 1,
"name": "Evaluation BizCore",
},
{
"id": 2,
"name": "Certification Fizz"
}
]
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 2,
"total_results": 2
}
} 在此表中,我使用包的名称呈现一列,第二列我需要呈现 Services 数组中的任何名称属性。该列具有此数据索引:
dataIndex: ['services', 'name'],
如果有多个属性名称,则应使用“,”分隔渲染。我尝试了不同的方法,但似乎没有任何效果。 谢谢!!
【问题讨论】: