|  | @@ -5,13 +5,12 @@
 | 
	
		
			
			| 5 | 5 |  `version 0.2.0`
 | 
	
		
			
			| 6 | 6 |  
 | 
	
		
			
			| 7 | 7 |  ```js
 | 
	
		
			
			| 8 |  | -import Comment, { Editor } from 'comment';
 | 
	
		
			
			|  | 8 | +import Comment, { Editor, RenderText } from 'comment';
 | 
	
		
			
			| 9 | 9 |  ```
 | 
	
		
			
			| 10 | 10 |  
 | 
	
		
			
			|  | 11 | +- [deprecate] 表示不推荐使用
 | 
	
		
			
			| 11 | 12 |  
 | 
	
		
			
			| 12 |  | -## Props
 | 
	
		
			
			| 13 |  | -
 | 
	
		
			
			| 14 |  | -#### Comment
 | 
	
		
			
			|  | 13 | +## Comment
 | 
	
		
			
			| 15 | 14 |  
 | 
	
		
			
			| 16 | 15 |  
 | 
	
		
			
			| 17 | 16 |  | props      | type    | default                            | required | description                                  |
 | 
	
	
		
			
			|  | @@ -22,11 +21,11 @@ import Comment, { Editor } from 'comment';
 | 
	
		
			
			| 22 | 21 |  | showList   | boolean | true                               | false    | 是否显示评论列表                             |
 | 
	
		
			
			| 23 | 22 |  | showEditor | boolean | true                               | false    | 是否显示评论输入框                           |
 | 
	
		
			
			| 24 | 23 |  | showHeader | boolean | true                               | false    | 是否显示评论顶部的提示                       |
 | 
	
		
			
			| 25 |  | -| token      | string  |                                    | false    | token,用于身份认证,非必须。默认使用 cookie |
 | 
	
		
			
			|  | 24 | +| token      | string  |                                    | false    |  [deprecate] token,用于身份认证,非必须。默认使用 cookie |
 | 
	
		
			
			| 26 | 25 |  
 | 
	
		
			
			| 27 | 26 |  
 | 
	
		
			
			| 28 | 27 |  
 | 
	
		
			
			| 29 |  | -##### Editor
 | 
	
		
			
			|  | 28 | +## Editor
 | 
	
		
			
			| 30 | 29 |  
 | 
	
		
			
			| 31 | 30 |  | props         | type            | default       | required | description                                                                                       |
 | 
	
		
			
			| 32 | 31 |  | ------------- | --------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------- |
 | 
	
	
		
			
			|  | @@ -36,7 +35,7 @@ import Comment, { Editor } from 'comment';
 | 
	
		
			
			| 36 | 35 |  | showUpload    | boolean         | true          | false    | 是否显示 Toolbar 中 上传图片工具                                                                  |
 | 
	
		
			
			| 37 | 36 |  | value         | string          |               | false    | 编辑器的值。如果设置了该属性,则编辑器变为受控组件,需要父组件来维护 value                        |
 | 
	
		
			
			| 38 | 37 |  | onChange      | function(value) |               | false    | 编辑器内容改变的回调函数                                                                          |
 | 
	
		
			
			| 39 |  | -| onSubmit      | function(value) |               | false    | 点击提交按钮的回调函数                                                                            |
 | 
	
		
			
			|  | 38 | +| onSubmit      | function({ text, files }) |               | false    | 点击提交按钮的回调函数,text 为编辑器的文本,files 为上传的文件列表                           |
 | 
	
		
			
			| 40 | 39 |  | btnSubmitText | string          | 发表          | false    | 提交按钮的文字                                                                                    |
 | 
	
		
			
			| 41 | 40 |  | btnLoading    | boolean         | false         | false    | 按钮是否正在加载中                                                                                |
 | 
	
		
			
			| 42 | 41 |  | btnDisable    | boolean         | false         | false    | 按钮是否禁用                                                                                      |
 | 
	
	
		
			
			|  | @@ -131,18 +130,30 @@ handleChangeSubmit() {
 | 
	
		
			
			| 131 | 130 |  }
 | 
	
		
			
			| 132 | 131 |  
 | 
	
		
			
			| 133 | 132 |  
 | 
	
		
			
			| 134 |  | -<App type={1} businessId="test">
 | 
	
		
			
			|  | 133 | +<Comment type={1} businessId="test">
 | 
	
		
			
			| 135 | 134 |    <Editor 
 | 
	
		
			
			| 136 | 135 |      // 使用 onRef 方法创建一个 Editor 组件的引用,并添加到 this 上面
 | 
	
		
			
			| 137 | 136 |      onRef={ref => this.editor = ref } 
 | 
	
		
			
			| 138 | 137 |      onSubmit={() => this.handleChangeSubmit()}
 | 
	
		
			
			| 139 | 138 |    />
 | 
	
		
			
			| 140 |  | -</App>
 | 
	
		
			
			|  | 139 | +</Comment>
 | 
	
		
			
			| 141 | 140 |  ```
 | 
	
		
			
			| 142 | 141 |  
 | 
	
		
			
			| 143 | 142 |  **注意上面的 `onRef={ref => this.editor = ref }`**,这是实现父组件调用子组件方法的关键。**
 | 
	
		
			
			| 144 | 143 |  
 | 
	
		
			
			| 145 | 144 |  
 | 
	
		
			
			|  | 145 | +## RenderText
 | 
	
		
			
			|  | 146 | +
 | 
	
		
			
			|  | 147 | +```jsx
 | 
	
		
			
			|  | 148 | +
 | 
	
		
			
			|  | 149 | +import { RenderText } from 'comment';
 | 
	
		
			
			|  | 150 | +
 | 
	
		
			
			|  | 151 | +render() {
 | 
	
		
			
			|  | 152 | +  return RenderText('test [呲牙]')
 | 
	
		
			
			|  | 153 | +}
 | 
	
		
			
			|  | 154 | +```
 | 
	
		
			
			|  | 155 | +
 | 
	
		
			
			|  | 156 | +
 | 
	
		
			
			| 146 | 157 |  ## 使用
 | 
	
		
			
			| 147 | 158 |  
 | 
	
		
			
			| 148 | 159 |  
 | 
	
	
		
			
			|  | @@ -230,7 +241,7 @@ $ yarn start
 | 
	
		
			
			| 230 | 241 |  
 | 
	
		
			
			| 231 | 242 |  - `yarn build` 将项目打包成一个单页应用
 | 
	
		
			
			| 232 | 243 |  - `yarn lib` 将项目打包成一个 es5 组件
 | 
	
		
			
			| 233 |  | -- `yarn prettier` 格式化代码
 | 
	
		
			
			|  | 244 | +- `yarn prettier` 优化代码格式
 | 
	
		
			
			| 234 | 245 |  
 | 
	
		
			
			| 235 | 246 |  ## TODO
 | 
	
		
			
			| 236 | 247 |  
 |