表格添加一个setRows方法以便数据回显后重新获取数据 (#2327)
This commit is contained in:
parent
17d16ae545
commit
eda251a426
|
|
@ -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): [
|
||||||
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';
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue