Element-UI的table实现分页多选功能

selection-change事件:当选择项发生变化时会触发该事件(当分页切换时,选中的数据都会自动情况)

分页多选

  • 在el-table中添加 :row-key="getRowKeys"

getRowKeys(row) {
	return row.id
},
handleChange(selection) {
    console.log(selection)
}
  • 然后第一列,即有多选框的一列,添加 :reserve-selection="true"

你可能感兴趣的:(#,Vue,ui,elementui,前端)