docs: simplify select virtual demo (#44759)

This commit is contained in:
afc163 2023-09-11 16:04:53 +08:00 committed by GitHub
parent 0cb23a8004
commit c11e18411c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 32 deletions

View File

@ -371,11 +371,6 @@ exports[`renders components/select/demo/basic.tsx correctly 1`] = `
exports[`renders components/select/demo/big-data.tsx correctly 1`] = `
Array [
<h3
class="ant-typography"
>
Ant Design 4.0
</h3>,
<h4
class="ant-typography"
>
@ -510,20 +505,6 @@ Array [
</span>
</span>
</div>,
<div
class="ant-divider ant-divider-horizontal"
role="separator"
/>,
<h3
class="ant-typography"
>
Ant Design 3.0
</h3>,
<iframe
src="https://codesandbox.io/embed/solitary-voice-m3vme?fontsize=14&hidenavigation=1&theme=dark&view=preview"
style="width:100%;height:300px"
title="Ant Design 3.0 Select demo"
/>,
]
`;

View File

@ -1,7 +1,7 @@
## zh-CN
Select 使用了[虚拟滚动](https://github.com/react-component/virtual-list)技术,因而获得了比 [3.0 更好的性能](https://codesandbox.io/s/beautiful-banzai-m72lv)
Select 默认针对大数据开启了[虚拟滚动](https://github.com/react-component/virtual-list),因而获得了更好的性能,可以通过 `virtual={false}` 关闭
## en-US
Select use [virtual scroll](https://github.com/react-component/virtual-list) which get better performance [than 3.0](https://codesandbox.io/s/beautiful-banzai-m72lv).
Select use [virtual scroll](https://github.com/react-component/virtual-list) which get better performance, turn off it by set `virtual={false}`.

View File

@ -1,6 +1,6 @@
import React from 'react';
import type { SelectProps } from 'antd';
import { Divider, Select, Typography } from 'antd';
import { Select, Typography } from 'antd';
const { Title } = Typography;
@ -21,7 +21,6 @@ const handleChange = (value: string[]) => {
const App: React.FC = () => (
<>
<Title level={3}>Ant Design 4.0</Title>
<Title level={4}>{options.length} Items</Title>
<Select
mode="multiple"
@ -31,15 +30,6 @@ const App: React.FC = () => (
onChange={handleChange}
options={options}
/>
<Divider />
<Title level={3}>Ant Design 3.0</Title>
<iframe
title="Ant Design 3.0 Select demo"
src="https://codesandbox.io/embed/solitary-voice-m3vme?fontsize=14&hidenavigation=1&theme=dark&view=preview"
style={{ width: '100%', height: 300 }}
/>
</>
);