需求:业务要求需要把变更后的的字体颜色修改为红色
过程:使用table cell-style属性(结果不生效,由于这里的插槽里放了select)
代码:methods:{
cellStyle ({ row,column,rowIndex,columnIndex }) {
//第n(3)列的时候,才改变
if (columnIndex === 3) {
return `color:red`;
}else{
return ``;
}
}
}
最后:在那列插槽的select加个类名,修改样式
html:
<el-select
v-model="scope.row.after"
placeholder="请选择"
class="red"
v-if="scope.row.type === &