Browse Source

更新 'README.md'

node 5 years ago
parent
commit
c8a48fa1b7
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      README.md

+ 2
- 2
README.md View File

@@ -54,12 +54,12 @@ import Comment, { Editor } from 'comment';
54 54
 
55 55
 ```jsx
56 56
 // 单独使用 Editor
57
-<Editor value="xxx" onChange={(v) => console.log(v)} />
57
+<Editor value={this.state.value} onChange={(v) => this.setState({ value })} />
58 58
 
59 59
 // 不需要展示评论列表
60 60
 
61 61
 <Comment type={1}  showList={false}>
62
-  <Editor value="xxx" onChange={(v) => console.log(v)} />
62
+  <Editor value={this.state.value} onChange={(v) => this.setState({ value })} />
63 63
 </Comment>
64 64
 
65 65
 ```