@@ -25,7 +25,7 @@ React Mentions
2525
2626## Screenshots
2727
28- <img src =" https://user-images.githubusercontent.com/8186664/50768510-a8b30680-12bb -11e9-8251-0e0ed82c5076 .png " />
28+ <img src =" https://user-images.githubusercontent.com/5378891/57270992-2fd48780-70c0 -11e9-91ae-c614d0b49a45 .png " />
2929
3030## Feature
3131
@@ -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,26 @@ 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+ | notFoundContent | Set mentions content when not match | ReactNode | 'Not Found' |
76+ | onChange | Trigger when value changed | (text: string) => void | - |
77+ | onSelect | Trigger when user select the option | (option: OptionProps, prefix: string) => void | - |
78+ | onSearch | Trigger when prefix hit | (text: string, prefix: string) => void | - |
79+ | onFocus | Trigger when mentions get focus | React.FocusEventHandler<HTMLTextAreaElement > | - |
80+ | onBlur | Trigger when mentions lose focus | React.FocusEventHandler<HTMLTextAreaElement > | - |
6481
6582### Methods
6683
67- | name | description | parameters | return |
68- | ----------| ----------------| ----------| --------------|
69- | | | | |
84+ | name | description |
85+ | ----------| ----------------|
86+ | focus() | Component get focus |
87+ | blur() | Component lose focus |
7088
7189## Development
7290
0 commit comments