The element component Table form realizes that the check box cannot be checked under certain conditions

need:

There is a check box for implementing el-table, but it cannot be checked under the enabled condition.

code show as below:

<el-table :data="dataList" 	ref="multipleTable" :row-class-name="tableRowClassName" :row-key="getRowKey"
    @selection-change="selectionChangeHandle" @sort-change="sortChangeHandle">
      <el-table-column fixed="left" :selectable="checkSelect" :reserve-selection="true" type="selection" width="55" align="center"></el-table-column>
</el-table>
	//勾选置灰
      checkSelect (row,index) {
    
    
        let isChecked = true;
        if (row.statCd == 1) {
    
     // 判断里面是否存在某个参数
          isChecked = false
        } else {
    
    
          isChecked = true
        }
        return isChecked
      },

		//确定唯一的key值
      getRowKey(row){
    
    
        return row.id; //每条数据的唯一识别值
      },
		//字体颜色置灰
      tableRowClassName({
     
     row,rowIndex}){
    
    
        if (row.type === 1) {
    
     // 判断里面是否存在某个参数
          return 'fontSize'
        } 
        return ''
      },
<style>
  .el-table .fontSize{
    
    
    color: #BFBABA;
  }
</style>

Renderings:

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43883951/article/details/122376936