From 036a2c20a1a90ec4c56c565ccf227e754b64f8e1 Mon Sep 17 00:00:00 2001 From: Optimistic-Chen <64662582+DBSDs@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:21:28 +0800 Subject: [PATCH] chore: update table demo ts type (#38333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 虚拟滚动列表中的Parameters[0]改为泛型传参 虚拟滚动列表中的Parameters[0]改为泛型传参,可以定义通过datasource定义RecordType的值,而不是object * Update virtual-list.md * docs: virtualtable example use generic instead of 'Parameters[0]' * Update components/table/demo/virtual-list.md Co-authored-by: liangjun.chen Co-authored-by: afc163 --- components/table/demo/virtual-list.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/table/demo/virtual-list.md b/components/table/demo/virtual-list.md index bd8fd8335e..36b9da2053 100644 --- a/components/table/demo/virtual-list.md +++ b/components/table/demo/virtual-list.md @@ -14,13 +14,14 @@ title: Integrate virtual scroll with `react-window` to achieve a high performance table of 100,000 data. ```tsx -import { Table } from 'antd'; +import { Table } from 'antd'; +import type { TableProps } from 'antd'; import classNames from 'classnames'; import ResizeObserver from 'rc-resize-observer'; import React, { useEffect, useRef, useState } from 'react'; import { VariableSizeGrid as Grid } from 'react-window'; -const VirtualTable = (props: Parameters[0]) => { +const VirtualTable = (props: TableProps) => { const { columns, scroll } = props; const [tableWidth, setTableWidth] = useState(0);