fix: table search form slot not working as expected

This commit is contained in:
vben
2024-10-13 23:44:45 +08:00
parent 24d14c2841
commit ea962e75d0
10 changed files with 44 additions and 33 deletions

View File

@@ -1,9 +1,11 @@
import type { VxeGridProps } from 'vxe-table';
import type { VxeGridProps, VxeUIExport } from 'vxe-table';
import type { VxeGridApi } from './api';
import { isFunction } from '@vben/utils';
import dayjs from 'dayjs';
export function extendProxyOptions(
api: VxeGridApi,
options: VxeGridProps,
@@ -48,3 +50,17 @@ function extendProxyOption(
},
});
}
export function extendsDefaultFormatter(vxeUI: VxeUIExport) {
vxeUI.formats.add('formatDate', {
tableCellFormatMethod({ cellValue }) {
return dayjs(cellValue).format('YYYY-MM-DD');
},
});
vxeUI.formats.add('formatDateTime', {
tableCellFormatMethod({ cellValue }) {
return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss');
},
});
}