数据:
export const tableData = {
"data": [
{
"ctype": "海淀",
"clist": [
{
"companyName": "公司1",
"ydata": [
{
"year": "2021",
"hte": "1",
"tb": "2",
"ctype": null,
"companyName": null
},
{
"year": "2022",
"hte": "3",
"tb": "4",
"ctype": null,
"companyName": null
},
{
"year": "2023",
"hte": "5",
"tb": "6",
"ctype": null,
"companyName": null
},
]
},
{
"companyName": "公司2",
"ydata": [
{
"year": "2021",
"hte": "00",
"tb": "68",
"ctype": null,
"companyName": null
},
{
"year": "2022",
"hte": "50",
"tb": "49",
"ctype": null,
"companyName": null
},
{
"year": "2023",
"hte": "56",
"tb": "69",
"ctype": null,
"companyName": null
},
]
}
]
},
{
"ctype": "朝阳",
"clist": [
{
"companyName": "阿里巴巴",
"ydata": [
{
"year": "2021",
"hte": "50",
"tb": "-95",
"ctype": null,
"companyName": null
},
{
"year": "2022",
"hte": "50",
"tb": "-93.6",
"ctype": null,
"companyName": null
},
{
"year": "2023",
"hte": "579",
"tb": "-90",
"ctype": null,
"companyName": null
},
]
}
]
},
{
"ctype": "其他",
"clist": [
{
"companyName": "京东",
"ydata": [
{
"year": "2021",
"hte": "11",
"tb": "2331",
"ctype": null,
"companyName": null
},
{
"year": "2022",
"hte": "102",
"tb": "1682",
"ctype": null,
"companyName": null
},
{
"year": "2023",
"hte": "103",
"tb": "2993",
"ctype": null,
"companyName": null
},
]
},
{
"companyName": "谷歌",
"ydata": [
{
"year": "2021",
"hte": "88",
"tb": "-76",
"ctype": null,
"companyName": null
},
{
"year": "2022",
"hte": "880",
"tb": null,
"ctype": null,
"companyName": null
},
{
"year": "2023",
"hte": "8835",
"tb": "1092",
"ctype": null,
"companyName": null
},
]
},
]
},
]
}
效果:
不知道我描述清楚了没?
如果我没有说清楚的话麻烦看下这个例子,我应该怎么处理表格的数据
https://element-plus.run/#eyJzcmMvQXBwLnZ1ZSI6Ijx0ZW1wbGF0ZT5...
建议你可以做成 树形数据
element-plus 例子 树形数据与懒加载