Browse Source

docs(icon): edit api type

richard1015 3 years ago
parent
commit
181bad6110

+ 1 - 1
src/packages/__VUE/dialog/doc.en-US.md

@@ -213,7 +213,7 @@ export default {
 | Attribute             | Description                                                                    | Type                     | Default              |
 |-----------------------|--------------------------------------------------------------------------------|--------------------------|----------------------|
 | title                 | Title                                                                          | String                   | -                    |
-| id                    | Identifier, share one instance at the same time, default to multiple instances | String or Number         | new Date().getTime() |
+| id                    | Identifier, share one instance at the same time, default to multiple instances | string \| object         | new Date().getTime() |
 | content               | Content, support HTML                                                          | String                   | -                    |
 | teleport              | Specifies a target element where Dialog will be mounted                        | String                   | "body"               |
 | closeOnClickOverlay   | Whether to close when overlay is clicked                                       | Boolean                  | false                |

+ 12 - 12
src/packages/__VUE/icon/doc.en-US.md

@@ -2,7 +2,7 @@
 
 ### Intro
 
-Install the @nutui/icons-vue package independently. Two usage modes are provided (Svg on-demand usage and IconFont full usage).
+Install the [@nutui/icons-vue](https://github.com/jdf2e/nutui-icons) package independently. Two usage modes are provided (Svg on-demand usage and IconFont full usage).
 
 ### Install
 
@@ -16,7 +16,7 @@ Use mode of on-demand loading components, see @nutui/icons-vue/dist/types/index.
 ```js
 import { Add } from '@nutui/icons-vue';
 // template
-<Add color='red'>
+<Add color='red' />
 ```
 
 <icon-demo />
@@ -29,10 +29,10 @@ Loading,Location,Location2,Check,Close,Left,Service,Top,Right,CheckNormal,Checke
 
 | Attribute | Description                        | Type             | Default |
 |-----------|------------------------------------|------------------|---------|
-| name      | Icon name or URL                   | String           | -       |
-| color     | Icon color                         | String           | -       |
-| width     | Icon size , eg `20px` `2em` `2rem` | String or Number | -       |
-| height    | Icon size , eg `20px` `2em` `2rem` | String or Number | -       |
+| name      | Icon name or URL                   | string           | -       |
+| color     | Icon color                         | string           | -       |
+| width     | Icon size , eg `20px` `2em` `2rem` | string \| object | -       |
+| height    | Icon size , eg `20px` `2em` `2rem` | string \| object | -       |
 
 ### Events
 
@@ -191,12 +191,12 @@ custom iconfont [Demo](https://github.com/jdf2e/nutui-demo/blob/master/vite/src/
 
 | Attribute       | Description                                          | Type             | Default          |
 |-----------------|------------------------------------------------------|------------------|------------------|
-| name            | Icon name or URL                                     | String           | -                |
-| color           | Icon color                                           | String           | -                |
-| size            | Icon size , eg `20px` `2em` `2rem`                   | String or Number | -                |
-| font-class-name | Custom icon font base class name                     | String           | `nutui-iconfont` |
-| class-prefix    | Custom icon class name prefix for using custom icons | String           | `nut-icon`       |
-| tag             | HTML Tag of root element                             | String           | `i`              |
+| name            | Icon name or URL                                     | string           | -                |
+| color           | Icon color                                           | string           | -                |
+| size            | Icon size , eg `20px` `2em` `2rem`                   | string \| object | -                |
+| font-class-name | Custom icon font base class name                     | string           | `nutui-iconfont` |
+| class-prefix    | Custom icon class name prefix for using custom icons | string           | `nut-icon`       |
+| tag             | HTML Tag of root element                             | string           | `i`              |
 
 ### Events
 

+ 12 - 12
src/packages/__VUE/icon/doc.md

@@ -2,7 +2,7 @@
 
 ### 介绍
 
-独立安装 @nutui/icons-vue 图标组件包。提供两种使用方式(Svg 按需使用、IconFont 全量使用)。
+独立安装 [@nutui/icons-vue](https://github.com/jdf2e/nutui-icons) 图标组件包。提供两种使用方式(Svg 按需使用、IconFont 全量使用)。
 
 ### 安装
 
@@ -17,7 +17,7 @@ npm i --save @nutui/icons-vue
 ```js
 import { Add } from '@nutui/icons-vue';
 // template
-<Add color='red'>
+<Add color='red' />
 ```
 
 <icon-demo />
@@ -31,10 +31,10 @@ Loading,Location,Location2,Check,Close,Left,Service,Top,Right,CheckNormal,Checke
 
 | 参数   | 说明                             | 类型             | 默认值 |
 |--------|----------------------------------|------------------|--------|
-| name   | 图标名称或图片链接               | String           | -      |
-| color  | 图标颜色                         | String           | -      |
-| width  | 图标大小,如 `20px` `2em` `2rem` | String or Number | -      |
-| height | 图标大小,如 `20px` `2em` `2rem` | String or Number | -      |
+| name   | 图标名称或图片链接               | string           | -      |
+| color  | 图标颜色                         | string           | -      |
+| width  | 图标大小,如 `20px` `2em` `2rem` | string \| object | -      |
+| height | 图标大小,如 `20px` `2em` `2rem` | string \| object | -      |
 
 ### Events
 
@@ -193,12 +193,12 @@ import './assets/font/iconfont.css';
 
 | 参数            | 说明                                     | 类型             | 默认值           |
 |-----------------|------------------------------------------|------------------|------------------|
-| name            | 图标名称或图片链接                       | String           | -                |
-| color           | 图标颜色                                 | String           | -                |
-| size            | 图标大小,如 `20px` `2em` `2rem`         | String or Number | -                |
-| font-class-name | 自定义 icon 字体基础类名                 | String           | `nutui-iconfont` |
-| class-prefix    | 自定义 icon 类名前缀,用于使用自定义图标 | String           | `nut-icon`       |
-| tag             | HTML 标签                                | String           | `i`              |
+| name            | 图标名称或图片链接                       | string           | -                |
+| color           | 图标颜色                                 | string           | -                |
+| size            | 图标大小,如 `20px` `2em` `2rem`         | string \| object | -                |
+| font-class-name | 自定义 icon 字体基础类名                 | string           | `nutui-iconfont` |
+| class-prefix    | 自定义 icon 类名前缀,用于使用自定义图标 | string           | `nut-icon`       |
+| tag             | HTML 标签                                | string           | `i`              |
 
 ### Events
 

+ 9 - 9
src/packages/__VUE/icon/doc.taro.md

@@ -24,7 +24,7 @@ app.use(IconFont);
 ```js
 import { Add } from '@nutui/icons-vue-taro';
 // template
-<Add color='red'>
+<Add color='red' />
 ```
 
 ### 方式二:全量使用
@@ -172,14 +172,14 @@ import './assets/font/iconfont.css';
 
 ### Props
 
-| 参数            | 说明                                    | 类型             | 默认值           |
-|-----------------|-----------------------------------------|------------------|------------------|
-| name            | 图标名称或图片链接                      | String           | -                |
-| color           | 图标颜色                                | String           | -                |
-| size            | 图标大小,如 `20px` `2em` `2rem`        | String or Number | -                |
-| font-class-name | 自定义 icon 字体基础类名                | String           | `nutui-iconfont` |
-| class-prefix    | 自定义 icon 类名前缀,用于使用自定义图标 | String           | `nut-icon`       |
-| tag             | HTML 标签                               | String           | `i`              |
+| 参数            | 说明                                     | 类型             | 默认值           |
+|-----------------|------------------------------------------|------------------|------------------|
+| name            | 图标名称或图片链接                       | string           | -                |
+| color           | 图标颜色                                 | string           | -                |
+| size            | 图标大小,如 `20px` `2em` `2rem`         | string \| object | -                |
+| font-class-name | 自定义 icon 字体基础类名                 | string           | `nutui-iconfont` |
+| class-prefix    | 自定义 icon 类名前缀,用于使用自定义图标 | string           | `nut-icon`       |
+| tag             | HTML 标签                                | string           | `i`              |
 
 ### Events
 

+ 1 - 0
src/packages/__VUE/icon/index.scss

@@ -0,0 +1 @@
+@import '@nutui/icons-vue/dist/style_iconfont.css';

+ 1 - 1
src/packages/__VUE/uploader/doc.en-US.md

@@ -379,7 +379,7 @@ export default {
 | headers                   | Set request headers                                                                                                                              | Object                                     | {}               |
 | data                      | Uploading extra params or function which can return uploading extra params                                                                       | Object                                     | {}               |
 | upload-icon               | Upload area [icon name](#/en-US/component/icon) or image link                                                                                    | String                                     | "photograph"     |
-| upload-icon-size          | Upload area [icon size] (#/en-US/component/icon) size, such as `20px` `2em` `2rem`                                                               | String or Number                           | -                |
+| upload-icon-size          | Upload area [icon size] (#/en-US/component/icon) size, such as `20px` `2em` `2rem`                                                               | string \| object                           | -                |
 | xhr-state                 | The success status (status) value of the interface response                                                                                      | Number                                     | 200              |
 | with-credentials          | The ajax upload with cookie sent                                                                                                                 | Boolean                                    | false            |
 | multiple                  | Whether to support multiple file selection                                                                                                       | Boolean                                    | false            |

+ 22 - 17
src/sites/mobile-taro/vue/src/basic/pages/icon/index.vue

@@ -74,25 +74,30 @@ export default {
   > .nutui-iconfont {
     margin-right: 10px;
   }
-}
-.icon-ul {
-  display: flex;
-  flex-wrap: wrap;
-  .icon-li {
-    flex: 0 0 25%;
-    max-width: 25%;
+  .icon-ul,
+  .h5-ul,
+  ul {
     display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: center;
+    width: 100%;
+    flex-wrap: wrap;
+    .icon-li,
+    .h5-li,
+    li {
+      flex: 0 0 25%;
+      max-width: 25%;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
 
-    span {
-      height: 40px;
-      font-size: 12px;
-      text-align: center;
-    }
-    .nutui-iconfont {
-      margin: 16px 0 16px;
+      span {
+        height: 40px;
+        font-size: 12px;
+        text-align: center;
+      }
+      .nutui-iconfont {
+        margin: 16px 0 16px;
+      }
     }
   }
 }