element-ui 表格多选框 按条件禁用部分选项

temlpate

  	 <el-table
            :data="roomData"
            @selection-change="handleSelectionChangeRoom"
            ref="multipleTable"
          >
            <el-table-column
              type="selection"
              v-model="multipleSelection"
              :selectable='selectDisableRoom' 
            >
            </el-table-column>
            <el-table-column
              property="name"
              label="姓名"
            ></el-table-column>
          </el-table>

methods

	// 把 id 为 1 的项禁用
    selectDisableRoom (row, index) {
     
      if(row.id !== 1){
     
        return true
      }
    },

主要代码
:selectable=‘selectDisableRoom’
selectDisableRoom (row, index) {
if(row.id !== 1){
return true
}
},

你可能感兴趣的:(整理,element-ui)