diff --git a/.changeset/green-points-sort.md b/.changeset/green-points-sort.md new file mode 100644 index 000000000..09f2d1479 --- /dev/null +++ b/.changeset/green-points-sort.md @@ -0,0 +1,6 @@ +--- +"@hi-ui/table": minor +"@hi-ui/hiui": minor +--- + +feat(table): SettingDrawer 增加 onReset api (#3021) diff --git a/packages/ui/table/src/SettingDrawer.tsx b/packages/ui/table/src/SettingDrawer.tsx index 832a398ef..4dcbb8399 100644 --- a/packages/ui/table/src/SettingDrawer.tsx +++ b/packages/ui/table/src/SettingDrawer.tsx @@ -34,6 +34,7 @@ export const SettingDrawer = forwardRef { setCacheHiddenColKeys(hiddenColKeys) setCacheSortedCols(sortedCols) + + onReset?.() }) // 当 visible 由 false 变为 true 时触发 @@ -220,6 +223,10 @@ export interface SettingDrawerProps extends HiBaseHTMLProps<'div'> { hiddenColKeys: string[], visibleCols: TableColumnItem[] ) => void + /** + * 重置按钮点击时回调 + */ + onReset?: () => void /** * 隐藏列 */