From 155b8173468f667e0e441c7fcb834c3bc28fba2f Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Mon, 7 Nov 2022 19:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/hooks/useTable.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/Table/src/hooks/useTable.ts b/src/components/Table/src/hooks/useTable.ts index 7217538..40575a3 100644 --- a/src/components/Table/src/hooks/useTable.ts +++ b/src/components/Table/src/hooks/useTable.ts @@ -61,9 +61,15 @@ export function useTable(tableProps?: Props): [ } return table as TableActionType; } + + function getTableRef(){ + return tableRef; + } const methods: TableActionType & { getForm: () => FormActionType; + } & { + getTableRef: () => any; } = { reload: async (opt?: FetchParams) => { return await getTableInstance().reload(opt); @@ -153,6 +159,9 @@ export function useTable(tableProps?: Props): [ collapseAll: () => { getTableInstance().collapseAll(); }, + getTableRef: () => { + return getTableRef(); + } }; return [register, methods];