update metion docs

This commit is contained in:
afc163 2016-07-21 15:23:04 +08:00
parent 92d127d8a5
commit aa8e02326a
8 changed files with 14 additions and 23 deletions

View File

@ -12,7 +12,6 @@ title: 异步加载
asnyc
````jsx
import { Mention } from 'antd';
const users = ['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai'];

View File

@ -14,7 +14,6 @@ title: 头像
Customize suggestions
````jsx
import { Mention } from 'antd';
const Nav = Mention.Nav;

View File

@ -12,11 +12,9 @@ title: 基本使用
Basic usage.
````jsx
import { Mention } from 'antd';
const { toString, toEditorState } = Mention;
function onChange(editorState) {
console.log(toString(editorState));
}

View File

@ -12,7 +12,6 @@ title: 受控模式
Controlled mode, for example, work with `Form` .
````jsx
import { Mention, Form, Button } from 'antd';
const { toEditorState, getMentions } = Mention;
const FormItem = Form.Item;

View File

@ -11,7 +11,7 @@ title: 自定义建议
## en-US
Customize suggestions
Customize suggestions.
````jsx
import { Mention } from 'antd';

View File

@ -12,7 +12,6 @@ title: 多行
Multi lines mode.
````jsx
import { Mention } from 'antd';
const { toString } = Mention;

View File

@ -12,19 +12,18 @@ Mention component。
When need to mention someone or something.
```html
<Mention
onChange={onChange}
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
/>,
```jsx
<Mention
onChange={onChange}
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
/>
```
## API
### Mention API
| API | Description | Type |
| API | Description | Type |
|----------|---------------|----------|--------------|
| toString | convert EditorState to string | Function(editorState: EditorState): String |
| toEditorState | convert string to EditorState | Function(string: String): EditorState |

View File

@ -6,30 +6,29 @@ type: Views
english: Mention
---
提及组件。(圈人组件)
提及组件。
## 何时使用
用于在输入中提及某人或某事。
```html
<Mention
onChange={onChange}
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
/>,
```jsx
<Mention
onChange={onChange}
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
/>
```
## API
### Mention API
| API | 说明 | 类型 |
| API | 说明 | 类型 |
|----------|---------------|----------|
| toString | 把 EditorState 转成字符串 | Function(editorState: EditorState): String |
| toEditorState | 把字符串转成 EditorState | Function(string: String): EditorState |
| getMentions | 获取当前 editorState 中提到的人的列表 | Function(editorState: EditorState): Array<String> |
### Mention props
| 参数 | 说明 | 类型 | 默认值 |
@ -44,7 +43,6 @@ english: Mention
| defaultValue | 默认值 | EditorState, 可以用 Mention.toEditorState(text) 把文字转换成 EditorState | null |
| value | 值 | EditorState | null |
### Nav props
| 参数 | 说明 | 类型 | 默认值 |