refactor: 判断vxe-table的复选框是否选中

This commit is contained in:
dap
2024-12-11 11:09:16 +08:00
parent 3014b62086
commit 7ec3cfb3fd
19 changed files with 62 additions and 157 deletions

View File

@@ -107,6 +107,7 @@ export type * from '@vben/plugins/vxe-table';
/**
* 通用的表格复选框是否选中事件
* @deprecated 使用vxeCheckboxChecked代替
* @param checked 是否选中
* @returns function
*/
@@ -118,3 +119,14 @@ export function tableCheckboxEvent(checked: Ref<boolean>) {
};
return event;
}
/**
* 判断vxe-table的复选框是否选中
* @param tableApi api
* @returns boolean
*/
export function vxeCheckboxChecked(
tableApi: ReturnType<typeof useVbenVxeGrid>[1],
) {
return tableApi?.grid?.getCheckboxRecords?.()?.length > 0;
}