在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 ? "" : ")"}`}} &nbsp; &nbsp;
           </span>
      </template>
</el-table-column>

4.实现

 

 

 

posted @ 2022-08-04 16:28  你猜我为啥秃头  阅读(1324)  评论(0)    收藏  举报