Browse Source

docs: update umd usage (#329)

Neptune 3 years ago
parent
commit
285be9ca47

+ 22 - 6
content/start/getting-started/index-en-US.md

@@ -42,14 +42,22 @@ class Demo extends React.Component {
 
 
 > We do not recommend using the built file directly, as this will introduce all components in full and cannot be loaded on demand. But if there is indeed a need for non-construction scenarios, you can quote in the following ways
 > We do not recommend using the built file directly, as this will introduce all components in full and cannot be loaded on demand. But if there is indeed a need for non-construction scenarios, you can quote in the following ways
 
 
-Use script and link tags to import files directly in the browser, and use the global variable `SemiUI`
+Use script and link tags to import files directly in the browser, and use the global variable `SemiUI`、`SemiIcons`、`SemiIllustrations`
 
 
 1. Please make sure you have import `react` and `react-dom` in advance
 1. Please make sure you have import `react` and `react-dom` in advance
 2. Import the JS file, the following example URL 2.0.0 is the version identifier, if you want to use a different version of Semi, just replace the corresponding value in version (note that the build file is only available after v1.3.0)
 2. Import the JS file, the following example URL 2.0.0 is the version identifier, if you want to use a different version of Semi, just replace the corresponding value in version (note that the build file is only available after v1.3.0)
-    - min:`https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.min.js`
-    - normal: `https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.js`
+    - semi-ui min:`https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.min.js`
+    - semi-ui normal: `https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.js`
+
+
+    - semi-icons min: `https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.min.js`
+    - semi-icons normal: `https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.js`
+
+    - semi-illustrations min: `https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.min.js`
+    - semi-illustrations normal: `https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.js`
 3. Import the CSS style file of the Semi default theme
 3. Import the CSS style file of the Semi default theme
-   `https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css`  
+    - `https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css`
+    - `https://unpkg.com/@douyinfe/semi-icons@latest/dist/css/semi-icons.css`
 
 
 ```diff
 ```diff
 <!DOCTYPE html>
 <!DOCTYPE html>
@@ -62,9 +70,13 @@ Use script and link tags to import files directly in the browser, and use the gl
 +       <script src="https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.min.js"></script>
 +       <script src="https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui-react.min.js"></script>
 +       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css">
 +       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css">
 
 
++       <script src="https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.min.js"></script>
++       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/semi-icons@latest/dist/css/semi-icons.css">
++       <script src="https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.min.js"></script>
+
     </head>
     </head>
     <body>
     <body>
-        <div id="root">1</div>
+        <div id="root"></div>
     </body>
     </body>
 </html>
 </html>
 ```
 ```
@@ -72,10 +84,14 @@ Use script and link tags to import files directly in the browser, and use the gl
 ```html
 ```html
 <script type="text/babel">
 <script type="text/babel">
     const { Input, Button, Toast, Icon, Form } = SemiUI;
     const { Input, Button, Toast, Icon, Form } = SemiUI;
+    const { IconHome } = SemiIcons;
+    const { IllustrationConstruction } = SemiIllustrations;
     ReactDOM.render(
     ReactDOM.render(
     <div>
     <div>
         <Button onClick={() => Toast.warning({ duration: 0, content: 'Semi Design' })}>test</Button>
         <Button onClick={() => Toast.warning({ duration: 0, content: 'Semi Design' })}>test</Button>
         <Input defaultValue="semi" onChange={value => Toast.info('abc')}></Input>
         <Input defaultValue="semi" onChange={value => Toast.info('abc')}></Input>
+        <IconHome size="large" />
+        <IllustrationConstruction style={{width: 150, height: 150}} />
     </div>, document.getElementById("root"));
     </div>, document.getElementById("root"));
-</script>;
+</script>
 ```
 ```

+ 22 - 7
content/start/getting-started/index.md

@@ -43,14 +43,21 @@ class Demo extends React.Component {
 
 
 > 我们并不推荐直接使用已构建文件,这样会全量引入所有组件,无法实现按需加载。但如果确实有非构建场景的需求,可以通过以下方式引用
 > 我们并不推荐直接使用已构建文件,这样会全量引入所有组件,无法实现按需加载。但如果确实有非构建场景的需求,可以通过以下方式引用
 
 
-在浏览器中使用 script 和 link 标签直接引入文件,并使用全局变量 `SemiUI`
+在浏览器中使用 script 和 link 标签直接引入文件,并使用全局变量 `SemiUI`、`SemiIcons`、`SemiIllustrations`
 
 
 1. 请确保你已提前引入 react 以及 react-dom
 1. 请确保你已提前引入 react 以及 react-dom
 2. 引入 JS 文件,以下示例 URL 中 2.0.0 为 version 标识,希望使用不同版本 Semi 时,将 version 中对应的值替换即可(注意构建文件仅在 v1.3.0 后开始提供)
 2. 引入 JS 文件,以下示例 URL 中 2.0.0 为 version 标识,希望使用不同版本 Semi 时,将 version 中对应的值替换即可(注意构建文件仅在 v1.3.0 后开始提供)
-    - min:`https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.min.js`
-    - normal: `https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.js`
+    - semi-ui min:`https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.min.js`
+    - semi-ui normal: `https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.js`
+
+    - semi-icons min: `https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.min.js`
+    - semi-icons normal: `https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.js`
+
+    - semi-illustrations min: `https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.min.js`
+    - semi-illustrations normal: `https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.js`
 3. 引入 Semi 默认主题的 CSS 样式文件  
 3. 引入 Semi 默认主题的 CSS 样式文件  
-   `https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css`
+    - `https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css`
+    - `https://unpkg.com/@douyinfe/semi-icons@latest/dist/css/semi-icons.css`
 
 
 ```diff
 ```diff
 <!DOCTYPE html>
 <!DOCTYPE html>
@@ -63,9 +70,13 @@ class Demo extends React.Component {
 +       <script src="https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.min.js"></script>
 +       <script src="https://unpkg.com/@douyinfe/[email protected]/dist/umd/semi-ui.min.js"></script>
 +       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css">
 +       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/[email protected]/dist/css/semi.css">
 
 
++       <script src="https://unpkg.com/@douyinfe/semi-icons@latest/dist/umd/semi-icons.min.js"></script>
++       <link rel="stylesheet" href="https://unpkg.com/@douyinfe/semi-icons@latest/dist/css/semi-icons.css">
++       <script src="https://unpkg.com/@douyinfe/semi-illustrations@latest/dist/umd/semi-illustrations.min.js"></script>
+
     </head>
     </head>
     <body>
     <body>
-        <div id="root">1</div>
+        <div id="root"></div>
     </body>
     </body>
 </html>
 </html>
 ```
 ```
@@ -73,10 +84,14 @@ class Demo extends React.Component {
 ```html
 ```html
 <script type="text/babel">
 <script type="text/babel">
     const { Input, Button, Toast, Icon, Form } = SemiUI;
     const { Input, Button, Toast, Icon, Form } = SemiUI;
+    const { IconHome } = SemiIcons;
+    const { IllustrationConstruction } = SemiIllustrations;
     ReactDOM.render(
     ReactDOM.render(
     <div>
     <div>
         <Button onClick={() => Toast.warning({ duration: 0, content: 'Semi Design' })}>test</Button>
         <Button onClick={() => Toast.warning({ duration: 0, content: 'Semi Design' })}>test</Button>
         <Input defaultValue="semi" onChange={value => Toast.info('hello semi')}></Input>
         <Input defaultValue="semi" onChange={value => Toast.info('hello semi')}></Input>
+        <IconHome size="large" />
+        <IllustrationConstruction style={{width: 150, height: 150}} />
     </div>, document.getElementById("root"));
     </div>, document.getElementById("root"));
-</script>;
-```
+</script>
+```