From 05c6d09eabc3890ff1d2d2a18b83f3d98142bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=86=E7=A6=BB?= Date: Thu, 20 Oct 2016 13:51:44 +0800 Subject: [PATCH] docs: add controllerd sample (#3504) * add controllerd sample * lint --- components/mention/demo/controllder-simple.md | 41 +++++++++++++++++++ components/mention/demo/controlled.md | 6 +-- components/mention/demo/multilines.md | 2 +- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 components/mention/demo/controllder-simple.md diff --git a/components/mention/demo/controllder-simple.md b/components/mention/demo/controllder-simple.md new file mode 100644 index 0000000000..721b04eaa9 --- /dev/null +++ b/components/mention/demo/controllder-simple.md @@ -0,0 +1,41 @@ +--- +order: 3 +title: + zh-CN: 受控模式 + en-US: Controlled +--- + +## zh-CN + +受控模式. + +## en-US + +Controlled mode. + +````jsx +import { Mention } from 'antd'; +const { toEditorState } = Mention; + +const App = React.createClass({ + getInitialState() { + return { + value: toEditorState('@afc163'), + }; + }, + handleChange(editorState) { + this.setState({ + value: editorState, + }); + }, + render() { + return (); + }, +}); + +ReactDOM.render(, mountNode); +```` diff --git a/components/mention/demo/controlled.md b/components/mention/demo/controlled.md index b20b6024a8..bdd9fe6282 100644 --- a/components/mention/demo/controlled.md +++ b/components/mention/demo/controlled.md @@ -1,8 +1,8 @@ --- -order: 3 +order: 4 title: - zh-CN: 受控模式 - en-US: Controlled + zh-CN: 配合 Form 使用 + en-US: With Form --- ## zh-CN diff --git a/components/mention/demo/multilines.md b/components/mention/demo/multilines.md index 3270dc8408..4c9a8dc0dd 100644 --- a/components/mention/demo/multilines.md +++ b/components/mention/demo/multilines.md @@ -1,5 +1,5 @@ --- -order: 4 +order: 5 title: zh-CN: 多行 en-US: Multi-lines Mode