mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-06 02:15:35 +08:00
67ee019478
* feat: reset and force update * feat: update package * feat: reset * feat: update for viewer * feat: update for viewer * feat: update for viewer * feat: update for viewer * feat: update for viewer * update doc * feat: add waring * feat: update doc * feat: add test case
37 lines
689 B
TypeScript
37 lines
689 B
TypeScript
import React from 'react';
|
|
import { Mentions } from 'antd';
|
|
import type { MentionsOptionProps } from 'antd/es/mentions';
|
|
|
|
const onChange = (value: string) => {
|
|
console.log('Change:', value);
|
|
};
|
|
|
|
const onSelect = (option: MentionsOptionProps) => {
|
|
console.log('select', option);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Mentions
|
|
style={{ width: '100%' }}
|
|
onChange={onChange}
|
|
onSelect={onSelect}
|
|
defaultValue="@afc163"
|
|
options={[
|
|
{
|
|
value: 'afc163',
|
|
label: 'afc163',
|
|
},
|
|
{
|
|
value: 'zombieJ',
|
|
label: 'zombieJ',
|
|
},
|
|
{
|
|
value: 'yesmeck',
|
|
label: 'yesmeck',
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
|
|
export default App;
|