vue3关于elementuiPlus表头合并问题?

数据:

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

},

]

},

]

},

]

}

效果:
vue3关于elementuiPlus表头合并问题?

不知道我描述清楚了没?
如果我没有说清楚的话麻烦看下这个例子,我应该怎么处理表格的数据
https://element-plus.run/#eyJzcmMvQXBwLnZ1ZSI6Ijx0ZW1wbGF0ZT5...


回答:

建议你可以做成 树形数据
element-plus 例子 树形数据与懒加载


回答:

占个坑,有空了我把代码贴上去,自己回答吧,供其他人参考

以上是 vue3关于elementuiPlus表头合并问题? 的全部内容, 来源链接: utcz.com/p/934619.html

回到顶部