当前位置:网站首页>El Table Radio select and hide the select all box

El Table Radio select and hide the select all box

2022-07-04 09:40:00 Meow sauce fell asleep

<el-table
  @selection-change="handleSelectionChange"
  ref="tableRef"
  :header-cell-class-name="cellClass"
>

Radio function :

    handleSelectionChange(selection) {
    
      if (selection.length > 1) {
    
        this.$refs.tableRef.clearSelection();
        this.$refs.tableRef.toggleRowSelection(selection.pop());
      }

    },

Hide select all box :

cellClass(row){
    
  if (row.columnIndex === 0 && row.rowIndex === 0) {
    
    return 'disableheadselection'
  }
}
<style lang="scss" scoped>
	/deep/ .disableheadselection > .cell .el-checkbox__inner {
    
	  display: none;
	}
<style>

Here's the picture : Only one can be checked at a time , You can't choose all .
 Insert picture description here

原网站

版权声明
本文为[Meow sauce fell asleep]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207040856430909.html