<vxe-table
          border
          align="center"
          size="mini"
          show-header-overflow
          show-overflow
          :row-config="{ isHover: true ,keyField:'id'}"
          class="mytable-scrollbar"
          max-height="450"
          :checkbox-config="checkBoxConfig"
        >
        </vxe-table>
//点击事件,获取到所有所选数据
const xTable=ref(null)
const saveClick=()=>{
  const $table = xTable.value
   // getCheckboxRecords 获取当前选中数据
  // getCheckboxReserveRecords 获取已保留选中行数
  //通过_.concat lodash合并两个数组
  const selectRecords 
  =_.concat($table.getCheckboxRecords(),$table.getCheckboxReserveRecords())
}
// 表格checkbox根据条件禁用
const checkBoxConfig = {
  checkMethod: ({ row }) => {
    return !row.disable
  },
  //开启保留翻页选中
  reserve:true
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注