Browse Source

support value props and controllred mode

pull/2259/head
RaoHai 8 years ago
parent
commit
69da207f3c
  1. 2
      components/mention/demo/basic.md
  2. 2
      components/mention/demo/multilines.md
  3. 3
      components/mention/index.en-US.md
  4. 2
      components/mention/index.tsx
  5. 3
      components/mention/index.zh-CN.md
  6. 2
      package.json

2
components/mention/demo/basic.md

@ -15,7 +15,7 @@ Basic usage.
import { Mention } from 'antd';
function onChange(value) {
function onChange(editorState, value) {
console.log(value);
}

2
components/mention/demo/multilines.md

@ -15,7 +15,7 @@ Multi lines mode.
import { Mention } from 'antd';
function onChange(value) {
function onChange(editorState, value) {
console.log(value);
}

3
components/mention/index.en-US.md

@ -28,11 +28,12 @@ When need to mention someone or something.
| suggestions | suggestion content | Array<string> or Array<Mention.Nav> | [] |
| suggestionStyle | style of suggestion container | Objet | {} |
| onSearchChange | Callback function called when search content changes | function(value:String) | [] |
| onChange | Callback function called when content of input changes | function(value:String) | null |
| onChange | Callback function called when content of input changes | function(editorState: EditorState, value:String) | null |
| notFoundContent| suggestion when suggestions empty | string | '无匹配结果,轻敲空格完成输入' |
| loading | loading mode | boolean | false |
| multiLines | multilines mode | boolean | false |
| defaultValue | default value | string | null |
| value | core state of mention | EditorState | null |
### Nav props

2
components/mention/index.tsx

@ -54,7 +54,7 @@ export default class Mention extends React.Component<MentionProps, MentionState>
onChange(editorState, textValue) {
if (this.props.onChange) {
this.props.onChange(textValue);
this.props.onChange(editorState, textValue);
}
}

3
components/mention/index.zh-CN.md

@ -28,11 +28,12 @@ english: Mention
| suggestions | 建议内容 | Array<string> or Array<Mention.Nav> | [] |
| suggestionStyle | 弹出下拉框样式 | Objet | {} |
| onSearchChange | 输入框中 @ 变化时回调 | function(value:String) | [] |
| onChange | 输入框内容变化时回调 | function(value:String) | null |
| onChange | 输入框内容变化时回调 | function(editorState: EditorState, value:String) | null |
| notFoundContent| 未找到时的内容 | string | '无匹配结果,轻敲空格完成输入' |
| loading | 加载中 | boolean | false |
| multiLines | 多行模式 | boolean | false |
| defaultValue | 默认值 | string | null |
| value | 值 | EditorState | null |
### Nav props

2
package.json

@ -47,7 +47,7 @@
"rc-collapse": "~1.6.3",
"rc-dialog": "~6.1.1",
"rc-dropdown": "~1.4.8",
"rc-editor-mention": "~0.0.27",
"rc-editor-mention": "0.0.29",
"rc-form": "~0.17.1",
"rc-input-number": "~2.5.12",
"rc-menu": "~4.12.4",

Loading…
Cancel
Save