mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
91821d4d3a
* feat: select edit demo to data driven * feat: edit demo to data driven Co-authored-by: 二货机器人 <smith3816@gmail.com>
843 B
843 B
order | title | ||||
---|---|---|---|---|---|
11 |
|
zh-CN
试下复制 露西,杰克
并粘贴到输入框里。只在 tags 和 multiple 模式下可用。
en-US
Try to copy Lucy,Jack
and paste to the input. Only available in tags and multiple mode.
import { Select } from 'antd';
import React from 'react';
import type { SelectProps } from 'antd';
const options: SelectProps['options'] = [];
for (let i = 10; i < 36; i++) {
options.push({
value: i.toString(36) + i,
label: i.toString(36) + i,
});
}
const handleChange = (value: string) => {
console.log(`selected ${value}`);
};
const App: React.FC = () => (
<Select
mode="tags"
style={{ width: '100%' }}
onChange={handleChange}
tokenSeparators={[',']}
options={options}
/>
);
export default App;