diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index 572c015d..b6e2aa25 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -1,6 +1,10 @@ -import { h } from 'vue'; +import { h, type Ref } from 'vue'; -import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table'; +import { + setupVbenVxeTable, + useVbenVxeGrid, + type VxeGridDefines, +} from '@vben/plugins/vxe-table'; import { Button, Image } from 'ant-design-vue'; @@ -94,3 +98,18 @@ setupVbenVxeTable({ export { useVbenVxeGrid }; export type * from '@vben/plugins/vxe-table'; + +/** + * 暂时没用上,先保留 + * 通用的表格复选框是否选中事件 + * @param checked 是否选中 + * @returns function + */ +export function tableCheckboxEvent(checked: Ref) { + const event: (params: VxeGridDefines.CheckboxChangeEventParams) => void = ( + params, + ) => { + checked.value = params.$table.getCheckboxRecords().length > 0; + }; + return event; +} diff --git a/packages/effects/plugins/src/vxe-table/index.ts b/packages/effects/plugins/src/vxe-table/index.ts index 2224dfaa..190a00b3 100644 --- a/packages/effects/plugins/src/vxe-table/index.ts +++ b/packages/effects/plugins/src/vxe-table/index.ts @@ -1,4 +1,4 @@ export { setupVbenVxeTable } from './init'; export * from './use-vxe-grid'; export { default as VbenVxeGrid } from './use-vxe-grid.vue'; -export type { VxeGridListeners, VxeGridProps } from 'vxe-table'; +export type { VxeGridDefines, VxeGridListeners, VxeGridProps } from 'vxe-table';