Skip to content

Commit

Permalink
fix(virtal-table): make virtual use components props
Browse files Browse the repository at this point in the history
  • Loading branch information
Asanio06 committed Nov 13, 2023
1 parent b0be0e3 commit 25fe5f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run compile
command: npm run start


11 changes: 10 additions & 1 deletion src/VirtualTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ export interface VirtualTableProps<RecordType> extends Omit<TableProps<RecordTyp
}

function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>, ref: React.Ref<Reference>) {
const { columns, scroll, sticky, prefixCls = DEFAULT_PREFIX, className, listItemHeight } = props;
const {
columns,
scroll,
sticky,
prefixCls = DEFAULT_PREFIX,
className,
listItemHeight,
components,
} = props;

let { x: scrollX, y: scrollY } = scroll || {};

Expand Down Expand Up @@ -63,6 +71,7 @@ function VirtualTable<RecordType>(props: VirtualTableProps<RecordType>, ref: Rea
x: scrollX,
}}
components={{
...components,
body: renderBody,
}}
columns={columns}
Expand Down

0 comments on commit 25fe5f3

Please sign in to comment.