2016-07-04 10:31:27 +08:00
|
|
|
---
|
|
|
|
category: Components
|
|
|
|
chinese: 提及
|
|
|
|
cols: 1
|
|
|
|
type: Views
|
|
|
|
english: Mention
|
|
|
|
---
|
|
|
|
|
|
|
|
提及组件。(圈人组件)
|
|
|
|
|
|
|
|
## 何时使用
|
|
|
|
|
|
|
|
用于在输入中提及某人或某事。
|
|
|
|
|
|
|
|
```html
|
|
|
|
<Mention
|
|
|
|
onChange={onChange}
|
|
|
|
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
|
|
|
|
/>,
|
|
|
|
```
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
### Mention props
|
|
|
|
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 |
|
|
|
|
|----------|---------------|----------|--------------|
|
|
|
|
| suggestions | 建议内容 | Array<string> or Array<Mention.Nav> | [] |
|
|
|
|
| suggestionStyle | 弹出下拉框样式 | Objet | {} |
|
|
|
|
| onSearchChange | 输入框中 @ 变化时回调 | function(value:String) | [] |
|
2016-07-18 16:58:08 +08:00
|
|
|
| onChange | 输入框内容变化时回调 | function(editorState: EditorState, value:String) | null |
|
2016-07-04 10:31:27 +08:00
|
|
|
| notFoundContent| 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' |
|
|
|
|
| loading | 加载中 | boolean | false |
|
|
|
|
| multiLines | 多行模式 | boolean | false |
|
|
|
|
| defaultValue | 默认值 | string | null |
|
2016-07-18 16:58:08 +08:00
|
|
|
| value | 值 | EditorState | null |
|
2016-07-04 10:31:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
### Nav props
|
|
|
|
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 |
|
|
|
|
|----------|---------------|----------|--------------|
|
|
|
|
| value | 建议值,选择建议时,用此值插入到输入框中 | string | "" |
|
|
|
|
| children | 建议内容 | Objet | {} |
|