mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
update metion docs
This commit is contained in:
parent
92d127d8a5
commit
aa8e02326a
@ -12,7 +12,6 @@ title: 异步加载
|
||||
asnyc
|
||||
|
||||
````jsx
|
||||
|
||||
import { Mention } from 'antd';
|
||||
|
||||
const users = ['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai'];
|
||||
|
@ -14,7 +14,6 @@ title: 头像
|
||||
Customize suggestions
|
||||
|
||||
````jsx
|
||||
|
||||
import { Mention } from 'antd';
|
||||
const Nav = Mention.Nav;
|
||||
|
||||
|
@ -12,11 +12,9 @@ title: 基本使用
|
||||
Basic usage.
|
||||
|
||||
````jsx
|
||||
|
||||
import { Mention } from 'antd';
|
||||
const { toString, toEditorState } = Mention;
|
||||
|
||||
|
||||
function onChange(editorState) {
|
||||
console.log(toString(editorState));
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -11,7 +11,7 @@ title: 自定义建议
|
||||
|
||||
## en-US
|
||||
|
||||
Customize suggestions
|
||||
Customize suggestions.
|
||||
|
||||
````jsx
|
||||
import { Mention } from 'antd';
|
@ -12,7 +12,6 @@ title: 多行
|
||||
Multi lines mode.
|
||||
|
||||
````jsx
|
||||
|
||||
import { Mention } from 'antd';
|
||||
const { toString } = Mention;
|
||||
|
||||
|
@ -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 |
|
||||
|
@ -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
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|
Loading…
Reference in New Issue
Block a user