|
@@ -5,14 +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
|
11
|
- [deprecate] 表示不推荐使用
|
12
|
12
|
|
13
|
|
-## Props
|
14
|
|
-
|
15
|
|
-#### Comment
|
|
13
|
+## Comment
|
16
|
14
|
|
17
|
15
|
|
18
|
16
|
| props | type | default | required | description |
|
|
@@ -27,7 +25,7 @@ import Comment, { Editor } from 'comment';
|
27
|
25
|
|
28
|
26
|
|
29
|
27
|
|
30
|
|
-##### Editor
|
|
28
|
+## Editor
|
31
|
29
|
|
32
|
30
|
| props | type | default | required | description |
|
33
|
31
|
| ------------- | --------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------- |
|
|
@@ -144,6 +142,18 @@ handleChangeSubmit() {
|
144
|
142
|
**注意上面的 `onRef={ref => this.editor = ref }`**,这是实现父组件调用子组件方法的关键。**
|
145
|
143
|
|
146
|
144
|
|
|
145
|
+## RenderText
|
|
146
|
+
|
|
147
|
+```jsx
|
|
148
|
+
|
|
149
|
+import { RenderText } from 'comment';
|
|
150
|
+
|
|
151
|
+render() {
|
|
152
|
+ return RenderText('test [呲牙]')
|
|
153
|
+}
|
|
154
|
+```
|
|
155
|
+
|
|
156
|
+
|
147
|
157
|
## 使用
|
148
|
158
|
|
149
|
159
|
|
|
@@ -231,7 +241,7 @@ $ yarn start
|
231
|
241
|
|
232
|
242
|
- `yarn build` 将项目打包成一个单页应用
|
233
|
243
|
- `yarn lib` 将项目打包成一个 es5 组件
|
234
|
|
-- `yarn prettier` 格式化代码
|
|
244
|
+- `yarn prettier` 优化代码格式
|
235
|
245
|
|
236
|
246
|
## TODO
|
237
|
247
|
|