需求要实现一个动态的列添加不同的数据 列名是一个接口动态获取, 列对应的单元格内容是和数组进行映射
<el-table-column prop=“deptName” label=“部门名称” align=“center” show-overflow-tooltip="" (显示省略号)>
{{deptAwardCount[scope.$index].awardCountVOs[index].totalCount}}
deptAwardCount的数组结构
deptAwardCount:[{deptID: 1
deptName: “中国移动通信集团政企客户分公司服务支撑中心”
awardCountVOs: [
{awardCountID: -1, awardID: 1, awardName: “一等奖”, totalCount: 0}
{awardCountID: -1, awardID: 2, awardName: “二等奖”, totalCount: 0}
{awardCountID: 436, awardID: 3, awardName: “三等奖”, totalCount: 4}
{awardCountID: 437, awardID: 4, awardName: “四等奖”, totalCount: 40}
{awardCountID: 438, awardID: 5, awardName: “五等奖”, totalCount: 41}
]
},
{
deptID: 2, deptName: “中国移动通信集团政企客户分公司”,…
awardCountVOs: [
{awardCountID: -1, awardID: 1, awardName: “一等奖”, totalCount: 0}
{awardCountID: -1, awardID: 2, awardName: “二等奖”, totalCount: 0}
{awardCountID: 436, awardID: 3, awardName: “三等奖”, totalCount: 4}
{awardCountID: 437, awardID: 4, awardName: “四等奖”, totalCount: 40}
{awardCountID: 438, awardID: 5, awardName: “五等奖”, totalCount: 41}
]
}
]
关于element列是个动态数组循环
最新推荐文章于 2023-10-31 17:18:19 发布