element table某些行背景顏色設置

<el-table
        :data="tableData"
        v-loading="loading"
        :row-class-name="tableRowClassName"
        ref="multipleTable"
        class="bgf"
        border
        header-row-class-name="lm-header-row"
        cell-class-name="lm-cell"
        style="width: 100%;"
      >


: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);
  }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章