在el-table-column中使用插槽solt 字符串拼接
1.数据在表格中展示是这样的

2.需要的效果是这样的
也就是上图红框里的字段
3.在el-table-column中使用插槽并且字符串拼接出想要的效果
<el-table-column prop="targetDescribe" label="考核期 指标行为描述"> <template slot-scope="scope" v-if="'targetDescribe'"> <span v-for="(item,index) in scope.row.performanceEfficiencyConfigItemModelList"> {{`${index + 1}.${item.answerText}${index == 2 ? "" : "("}${index == 2 ? "" : item.score }${index == 2 ? "" : ")"}`}} </span> </template> </el-table-column>
4.实现

浙公网安备 33010602011771号