@@ -47,9 +47,14 @@ React Mentions
4747``` js
4848import Mentions from ' rc-mentions' ;
4949
50- // TODO: update
50+ const { Option } = Mentions;
5151
5252var Demo = (
53+ < Mentions>
54+ < Option value= " light" > Light< / Option>
55+ < Option value= " bamboo" > Bamboo< / Option>
56+ < Option value= " cat" > Cat< / Option>
57+ < / Mentions>
5358);
5459React .render (< Demo / > , container);
5560```
@@ -60,13 +65,25 @@ React.render(<Demo />, container);
6065
6166| name | description | type | default |
6267| ----------| ----------------| ----------| --------------|
63- | | | | |
68+ | defaultValue | Default value | string | - |
69+ | value | Set value of mentions | string | - |
70+ | prefix | Set trigger prefix keyword | string \| string[ ] | '@' |
71+ | autoFocus | Auto get focus when component mounted | boolean | ` false ` |
72+ | split | Set split string before and after selected mention | string | ' ' |
73+ | validateSearch | Customize trigger search logic | (text: string, props: MentionsProps) => void | - |
74+ | filterOption | Customize filter option logic | false \| (input: string, option: OptionProps) => boolean | - |
75+ | onChange | Trigger when value changed | (text: string) => void | - |
76+ | onSelect | Trigger when user select the option | (option: OptionProps, prefix: string) => void | - |
77+ | onSearch | Trigger when prefix hit | (text: string, prefix: string) => void | - |
78+ | onFocus | Trigger when mentions get focus | React.FocusEventHandler<HTMLTextAreaElement > | - |
79+ | onBlur | Trigger when mentions lose focus | React.FocusEventHandler<HTMLTextAreaElement > | - |
6480
6581### Methods
6682
67- | name | description | parameters | return |
68- | ----------| ----------------| ----------| --------------|
69- | | | | |
83+ | name | description |
84+ | ----------| ----------------|
85+ | focus() | Component get focus |
86+ | blur() | Component lose focus |
7087
7188## Development
7289
0 commit comments