diff --git a/components/table/hooks/useFilter/FilterDropdown.tsx b/components/table/hooks/useFilter/FilterDropdown.tsx index 3abc2402f..fdf1abb7c 100644 --- a/components/table/hooks/useFilter/FilterDropdown.tsx +++ b/components/table/hooks/useFilter/FilterDropdown.tsx @@ -28,9 +28,9 @@ import type { CheckboxChangeEvent } from '../../../checkbox/interface'; import devWarning from '../../../vc-util/devWarning'; import isEqual from '../../../vc-util/isEqual'; -interface FilterRestProps { - confirm?: Boolean; - closeDropdown?: Boolean; +interface FilterResetProps { + confirm?: boolean; + closeDropdown?: boolean; } const { SubMenu, Item: MenuItem } = Menu; @@ -279,7 +279,7 @@ export default defineComponent>({ }; const onReset = ( - { confirm, closeDropdown }: FilterRestProps = { confirm: false, closeDropdown: false }, + { confirm, closeDropdown }: FilterResetProps = { confirm: false, closeDropdown: false }, ) => { if (confirm) { internalTriggerFilter([]); diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index a4e340184..1ff4d8e32 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -258,11 +258,20 @@ interface FilterDropdownProps { setSelectedKeys: (selectedKeys: Key[]) => void; selectedKeys: Key[]; confirm: (param?: FilterConfirmProps) => void; - clearFilters?: () => void; + clearFilters?: (param?: FilterResetProps) => void; filters?: ColumnFilterItem[]; visible: boolean; column: ColumnType; } + +interface FilterConfirmProps { + closeDropdown: boolean; +} + +interface FilterResetProps { + confirm?: boolean; + closeDropdown?: boolean; +} ``` ## Note diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 659319315..e8bcdd0bd 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -263,11 +263,20 @@ interface FilterDropdownProps { setSelectedKeys: (selectedKeys: Key[]) => void; selectedKeys: Key[]; confirm: (param?: FilterConfirmProps) => void; - clearFilters?: () => void; + clearFilters?: (param?: FilterResetProps) => void; filters?: ColumnFilterItem[]; visible: boolean; column: ColumnType; } + +interface FilterConfirmProps { + closeDropdown: boolean; +} + +interface FilterResetProps { + confirm?: boolean; + closeDropdown?: boolean; +} ``` ## 注意 diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 7270dee0a..1cb05c11e 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -78,13 +78,17 @@ export type FilterSearchType> = export interface FilterConfirmProps { closeDropdown: boolean; } +export interface FilterResetProps { + confirm?: boolean; + closeDropdown?: boolean; +} export interface FilterDropdownProps { prefixCls: string; setSelectedKeys: (selectedKeys: Key[]) => void; selectedKeys: Key[]; confirm: (param?: FilterConfirmProps) => void; - clearFilters?: () => void; + clearFilters?: (param?: FilterResetProps) => void; filters?: ColumnFilterItem[]; /** Only close filterDropdown */ close: () => void;