浏览代码

docs: Optimizing the usage example of color API (#1069)

YyumeiZhang 3 年之前
父节点
当前提交
8e4a27ec90
共有 2 个文件被更改,包括 12 次插入32 次删除
  1. 6 24
      content/show/tag/index-en-US.md
  2. 6 8
      content/show/tag/index.md

+ 6 - 24
content/show/tag/index-en-US.md

@@ -68,30 +68,12 @@ import { Tag, Space } from '@douyinfe/semi-ui';
 () => {
     return (
         <Space wrap>
-            <Tag color="grey" >
-                grey tag
-            </Tag>
-            <Tag color="blue" >
-                blue tag
-            </Tag>
-            <Tag color="red" >
-                red tag
-            </Tag>
-            <Tag color="green" >
-                green tag
-            </Tag>
-            <Tag color="orange" >
-                orange tag
-            </Tag>
-            <Tag color="teal" >
-                teal tag
-            </Tag>
-            <Tag color="violet" >
-                violet tag
-            </Tag>
-            <Tag color="white" >
-                white tag
-            </Tag>
+            {
+                ['amber', 'blue', 'cyan', 'green', 'grey', 'indigo',  
+                 'light-blue','light-green', 'lime', 'orange', 'pink',  
+                 'purple', 'red', 'teal','violet', 'yellow', 'white'
+                ].map(item => (<Tag color={item}> {item} tag</Tag>))
+            }
         </Space>
     );
 };

+ 6 - 8
content/show/tag/index.md

@@ -65,14 +65,12 @@ import { Tag, Space } from '@douyinfe/semi-ui';
 
 () => (
     <Space wrap>
-        <Tag color='grey'> grey tag </Tag>
-        <Tag color='blue'> blue tag </Tag>
-        <Tag color='red'> red tag </Tag>
-        <Tag color='green'> green tag </Tag>
-        <Tag color='orange'> orange tag </Tag>
-        <Tag color='teal'> teal tag </Tag>
-        <Tag color='violet'> violet tag </Tag>
-        <Tag color='white'> white tag </Tag>
+        {
+            ['amber', 'blue', 'cyan', 'green', 'grey', 'indigo',  
+             'light-blue','light-green', 'lime', 'orange', 'pink',  
+             'purple', 'red', 'teal','violet', 'yellow', 'white'
+            ].map(item => (<Tag color={item}> {item} tag </Tag>))
+        }
     </Space>
 );
 ```