Commit eda251a42672a9f8487a85bc36fe4187c046d805
Committed by
GitHub
1 parent
17d16ae5
表格添加一个setRows方法以便数据回显后重新获取数据 (#2327)
Showing
3 changed files
with
5 additions
and
0 deletions
src/components/Table/src/BasicTable.vue
src/components/Table/src/hooks/useTable.ts
... | ... | @@ -76,6 +76,9 @@ export function useTable(tableProps?: Props): [ |
76 | 76 | redoHeight: () => { |
77 | 77 | getTableInstance().redoHeight(); |
78 | 78 | }, |
79 | + setSelectedRows: (rows: Recordable[]) => { | |
80 | + return toRaw(getTableInstance().setSelectedRows(rows)); | |
81 | + }, | |
79 | 82 | setLoading: (loading: boolean) => { |
80 | 83 | getTableInstance().setLoading(loading); |
81 | 84 | }, | ... | ... |
src/components/Table/src/types/table.ts
... | ... | @@ -84,6 +84,7 @@ export type SizeType = 'default' | 'middle' | 'small' | 'large'; |
84 | 84 | |
85 | 85 | export interface TableActionType { |
86 | 86 | reload: (opt?: FetchParams) => Promise<void>; |
87 | + setSelectedRows: (rows: Recordable[]) => void; | |
87 | 88 | getSelectRows: <T = Recordable>() => T[]; |
88 | 89 | clearSelectedRowKeys: () => void; |
89 | 90 | expandAll: () => void; | ... | ... |