mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 05:29:37 +08:00
2ea28af6ed
* init * fix firefox * add active style * adjust arrow style * update select * update icon logic * render empty * init multiple * fix ff display style * sync font size * adjust padding style * add padding * padding it * hotfix of chrome * single sm * multiple size * update option group style * update snapshot * clean up transition * rm combobox in ts define * auto complete init * fix auto option def * update demo * update demo * update uncertain demo * update demo * warning if user set `size` on AutoComplete * add debug demo * updat demo * update demo of disabled * update snapshot * rm useless test * fix pagination test * fix Table test * fix calendar test case * fix calendar test case * adjust style * add big data demo * support clean up * fix ts define * fix lint * fix demo lint * fix style lint fix * rm useless deps * update snapshot * stop mock * add space
1.3 KiB
1.3 KiB
order | title | ||||
---|---|---|---|---|---|
23 |
|
zh-CN
Select 使用了虚拟滚动技术,因而获得了比 3.0 更好的性能。
en-US
Select use virtual scroll which get better performance than 3.0.
import { Select, Typography, Divider } from 'antd';
const { Title } = Typography;
const options = [];
for (let i = 0; i < 100000; i++) {
const value = `${i.toString(36)}${i}`;
options.push({
value,
disabled: i === 10,
});
}
function handleChange(value) {
console.log(`selected ${value}`);
}
ReactDOM.render(
<div>
<Title level={3}>Ant Design 4.0</Title>
<Title level={4}>{options.length} Items</Title>
<Select
mode="multiple"
style={{ width: '100%' }}
placeholder="Please select"
defaultValue={['a10', 'c12']}
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/beautiful-banzai-m72lv?view=preview"
style={{ width: '100%', height: 300 }}
/>
</div>,
mountNode,
);