element table某些行背景颜色设置




:row-class-name是设置的关键 table我就不写全了,比较麻烦
tableRowClassName({row}){
      console.log(row.reply_status);
      if(row.reply_status === 2){
        return 'warning-row';
      }
    },

row是获取到某一行的数据 reply_status是我列表数据中的一个字段用来判断哪些行需要颜色改变

改变css样式
/deep/.el-table .warning-row {
    background: rgba(0,255,255, 0.5);
  }

 

你可能感兴趣的:(vue学习)