1. el-table 增加如下代码,就会出现多选框

<el-table-column type="selection" class="checkbox-inp" width="55"></el-table-column>

 

2. 获取所选数据,需要给table 绑定事件@selection-change (@select不能获取表头全选框所选的数据)

@selection-change="checkSelect"
checkSelect(data){
    console.log(data)
}

 

3. 给表格默认加已选状态

this.tableData.forEach(row=>{
    this.$refs.table.toggleRowSelection(row, true)
})

相关文章:

  • 2021-12-06
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案