js处理
//this.newTableData 数组 this.newTableData.map((item,index)=>{ //item.label 数组 if(item.label){ item.label = item.label.join(','); } })
element UI table 中用插槽实现:
<el-table-column prop="label" label="客群标签"> <template slot-scope="scope"> <div class="label-ceil"> <div v-for="(item,ind) in scope.row.label" :key="ind"> <span v-if="ind+1 == scope.row.label.length">{{item}} </span> <span v-else>{{item}},</span> </div> </div> </template> </el-table-column>
数组最后一个不加逗号
标签:elementUI,label,逗号,item,数组,table From: https://www.cnblogs.com/yeziyou/p/16869970.html