头图

在 el-table-column type 类型为 selection 组件中,添加 :selectable='方法名'

<template>
  <el-table :data="tableData" v-loading="loading" max-height="570" stripe :header-cell-style="headerStyle" @selection-change="handleSelectionLeftChange">
     <el-table-column type="selection" :selectable='selectEnable'>
     </el-table-column>
  </el-table>
</template>

判断是否禁用方法函数

selectEnable(row, rowIndex) {
  if ('此处是判断条件') {
    return false //禁用
  } else {
    return true// 不禁用
  }
}

Dream_98311
9 声望0 粉丝

引用和评论

0 条评论