Unverified 提交 eda251a4 作者: zxiaozhou 提交者: GitHub

表格添加一个setRows方法以便数据回显后重新获取数据 (#2327)

上级 17d16ae5
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
getRowSelection, getRowSelection,
getRowSelectionRef, getRowSelectionRef,
getSelectRows, getSelectRows,
setSelectedRows,
clearSelectedRowKeys, clearSelectedRowKeys,
getSelectRowKeys, getSelectRowKeys,
deleteSelectRowByKey, deleteSelectRowByKey,
......
...@@ -76,6 +76,9 @@ export function useTable(tableProps?: Props): [ ...@@ -76,6 +76,9 @@ export function useTable(tableProps?: Props): [
redoHeight: () => { redoHeight: () => {
getTableInstance().redoHeight(); getTableInstance().redoHeight();
}, },
setSelectedRows: (rows: Recordable[]) => {
return toRaw(getTableInstance().setSelectedRows(rows));
},
setLoading: (loading: boolean) => { setLoading: (loading: boolean) => {
getTableInstance().setLoading(loading); getTableInstance().setLoading(loading);
}, },
......
...@@ -84,6 +84,7 @@ export type SizeType = 'default' | 'middle' | 'small' | 'large'; ...@@ -84,6 +84,7 @@ export type SizeType = 'default' | 'middle' | 'small' | 'large';
export interface TableActionType { export interface TableActionType {
reload: (opt?: FetchParams) => Promise<void>; reload: (opt?: FetchParams) => Promise<void>;
setSelectedRows: (rows: Recordable[]) => void;
getSelectRows: <T = Recordable>() => T[]; getSelectRows: <T = Recordable>() => T[];
clearSelectedRowKeys: () => void; clearSelectedRowKeys: () => void;
expandAll: () => void; expandAll: () => void;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论