Explorar el Código

更新 'README.md'

node hace 5 años
padre
commit
c8a48fa1b7
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      README.md

+ 2
- 2
README.md Ver fichero

@@ -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
 ```