From c563097faa4f5dfd9c04ace19999160c44bd6e80 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 29 Jun 2021 16:16:32 +0800 Subject: [PATCH] fix: table ColumnProps interface #4288 close #4288 --- components/table/interface.ts | 16 +++++++++++++--- v2-doc | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/components/table/interface.ts b/components/table/interface.ts index 1f188ca5c3..1784ecf21c 100644 --- a/components/table/interface.ts +++ b/components/table/interface.ts @@ -23,11 +23,15 @@ export const columnProps = { align: PropTypes.oneOf(tuple('left', 'right', 'center')), ellipsis: PropTypes.looseBool, filters: PropTypes.arrayOf(ColumnFilterItem), - // onFilter: (value: any, record: T) => PropTypes.looseBool, + onFilter: { + type: Function as PropType<(value: any, record: any) => boolean>, + }, filterMultiple: PropTypes.looseBool, filterDropdown: PropTypes.any, filterDropdownVisible: PropTypes.looseBool, - // onFilterDropdownVisibleChange?: (visible: boolean) => void; + onFilterDropdownVisibleChange: { + type: Function as PropType<(visible: boolean) => void>, + }, sorter: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func]), defaultSortOrder: PropTypes.oneOf(tuple('ascend', 'descend')), colSpan: PropTypes.number, @@ -51,7 +55,13 @@ export const columnProps = { }; export type ColumnProps = Partial> & { - slots?: Record; + slots?: { + title?: string; + filterIcon?: string; + filterDropdown?: string; + customRender?: string; + [key: string]: string; + }; }; export interface TableComponents { diff --git a/v2-doc b/v2-doc index 17ad24ea2a..31dce5d5c1 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit 17ad24ea2a8c09731ef35f7560aa47a7e306082a +Subproject commit 31dce5d5c125dc5aa8ea9e7e6dff01ef3fbcae9a