[Element-ui] table multi-selection box disable and multi-select across pages

前言

代码示例

  • table checkbox disabled
    html code

     <el-table-column type="selection" width="55" :selectable="_selectable"></el-table-column>
    

    js

    _selectable(row, index) {
          
          
      if (row.status === 0) {
          
          
        return true
      } else {
          
          
        return false
      }
    }
    
  • table cross-page multiple-choice
    First, table to add attributes: :row-key="_getRowKey".
    The row.experienceCardSn below corresponds to the unique value of the row data, usually id

     _getRowKey(row) {
          
          
          return row.experienceCardSn
    }
    

    Then checkbox add attribute:reserve-selection="true"

    <el-table-column
       type="selection"
       width="55"
       :reserve-selection="true"
     ></el-table-column>
    

Guess you like

Origin blog.csdn.net/s1441101265/article/details/108221394