Преглед изворни кода

docs: modify jsonviewer api desc (#2701)

Co-authored-by: 田丰 <[email protected]>
田丰 пре 7 месеци
родитељ
комит
e727d9a6ad
2 измењених фајлова са 3 додато и 1 уклоњено
  1. 1 0
      content/plus/jsonviewer/index-en-US.md
  2. 2 1
      content/plus/jsonviewer/index.md

+ 1 - 0
content/plus/jsonviewer/index-en-US.md

@@ -36,6 +36,7 @@ import { JsonViewer } from '@douyinfe/semi-ui';
 ### Basic Usage
 
 Basic usage of JsonViewer. Pass in the `height` and `width` parameters to set the height, width and initial value of the component. Pass in the JSON string through the `value`.
+Note: JsonViewer is an uncontrolled component. If the value prop is passed as a controlled property (i.e., React State), it is not recommended to modify the value prop (setState) in onChange. If you need to get the component's value, you can get it through ref, please refer to [Methods](#Methods) for details.
 
 ```jsx live=true dir="column" noInline=true
 import React from 'react';

+ 2 - 1
content/plus/jsonviewer/index.md

@@ -31,7 +31,8 @@ import { JsonViewer } from '@douyinfe/semi-ui';
 
 ### 基本用法
 
-JsonViewer 的基本用法。传入 height 和 width 参数,设置组件的高度和宽度和初始值。通过 value 传入 Json 字符串
+JsonViewer 的基本用法。传入 height 和 width 参数,设置组件的高度和宽度和初始值。通过 value 传入 Json 字符串  
+注意:JsonViewer 为非受控组件,若传入 value 属性为受控属性即React State,不建议在 onChange 中修改 value 属性即setState操作。若需要获取组件的值,可以通过 ref 获取,具体可参考 [Methods](#Methods)。
 
 ```jsx live=true dir="column" noInline=true
 import React from 'react';