Browse Source

docs: udpate typography notice

pointhalo 2 years ago
parent
commit
8a60e207c6
2 changed files with 18 additions and 5 deletions
  1. 9 2
      content/basic/typography/index-en-US.md
  2. 9 3
      content/basic/typography/index.md

+ 9 - 2
content/basic/typography/index-en-US.md

@@ -280,9 +280,12 @@ function Demo() {
 }
 ```
 
-### Interactive
+### Copyable text
 
-Copyable text.
+Copying of text can be supported by configuring the `copyable` property.  
+When copyable is configured as true, the default copied content is children itself. Note that at this time, children only support string type.    
+When copyable is configured as object, you can specify the content copied to the clipboard through `copyable.content`, which is no longer strongly associated with children.   
+At this time, children will no longer limit the type, but `copyable.content` still needs to be a string.  
 
 ```jsx live=true
 import React from 'react';
@@ -314,6 +317,10 @@ function Demo() {
 Show ellipsis if text is overflowed. Refer to [Ellipsis Config](#Ellipsis-Config) for detailed configuration.
 > At this moment, only pure text truncation is supported.
 
+<Notice title='Notice'>
+    ellipsis only supports truncation of plain text, and does not support complex types such as reactNode. Please ensure that the content type of children is string
+</Notice>
+
 ```jsx live=true
 import React from 'react';
 import { Typography } from '@douyinfe/semi-ui';

+ 9 - 3
content/basic/typography/index.md

@@ -269,8 +269,11 @@ function Demo() {
 }
 ```
 
-### 可交互文本
-支持文本的复制。
+### 可复制文本
+可通过配置 copyable 属性支持文本的复制。  
+当 copyable 配置为 true时,默认复制内容为 children 本身,注意,此时 children 只支持 string类型传入    
+当 copyable 配置为 object 时,可通过 `copyable.content` 指定复制至粘贴板的内容,与 children 不再强关联, 此时 children 将不再限定类型,但 `copyable.content` 仍需要为 string    
+
 ```jsx live=true
 import React from 'react';
 import { Typography, TextArea } from '@douyinfe/semi-ui';
@@ -299,7 +302,10 @@ function Demo() {
 ### 省略文本
 支持文本的省略,可以通过 `ellipsis` 配置相关参数,具体参考 [Ellipsis Config](#Ellipsis-Config)。
 
-> 目前只支持纯文本的截断
+<Notice title='注意事项'>
+    ellipsis 仅支持纯文本的截断,不支持 reactNode 等复杂类型,请确保 children 传入内容类型为 string
+</Notice>
+
 
 ```jsx live=true
 import React from 'react';