From f463d3258a954e64352df36004d34b0f12be9a8f Mon Sep 17 00:00:00 2001 From: xuqingkai Date: Sat, 2 Sep 2023 15:39:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20=E4=BC=98=E5=8C=96=E7=BC=BA?= =?UTF-8?q?=E7=9C=81=E7=8A=B6=E6=80=81=E7=BB=84=E4=BB=B6StautsTip=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?url=E5=92=8C=E5=9B=BE=E7=89=87=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/statusTip.md | 38 ++++++++++---- src/pages/statusTip/Index.vue | 24 ++++++--- .../components/wd-status-tip/index.scss | 7 ++- .../wd-status-tip/wd-status-tip.vue | 52 ++++++++++++------- src/uni_modules/wot-design-uni/readme.md | 5 +- 5 files changed, 84 insertions(+), 42 deletions(-) diff --git a/docs/component/statusTip.md b/docs/component/statusTip.md index a0c3d8a6..0fe00342 100644 --- a/docs/component/statusTip.md +++ b/docs/component/statusTip.md @@ -4,26 +4,44 @@ 一般用于兜底占位展示。 -> 若图片显示安全域名问题,需将 img11.360buyimg.com 域名添加为业务域名。 +> 本组件使用图片均为外链,推荐将图片下载到开发者的服务器后通过自定义图片`URL`使用。 ## 基本用法 -设置 `type` 修改展示缺省图片类型,默认为 'network',可选值 'search', 'network', 'content', 'collect', 'comment', 'halo', 'message'。可设置 `tip` 来控制展示提示文案。 +设置 `image` 修改展示缺省图片类型,默认为 `network`,可选值 `search`, `network`, `content`, `collect`, `comment`, `halo`, `message`。可设置 `tip` 来控制展示提示文案。 ```html - - - - - - - + + + + + + + +``` + +## 自定义大小 + +通过 `image-size` 属性图片的大小。 + +```html + +``` + +## 自定义图片 + +需要自定义图片时,可以在 `image` 属性中传入任意图片 URL。 + + +```html + ``` ## Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | |-----|------|-----|-------|-------|---------| -| type | 缺省类型 | string | search / network / content / collect / comment / halo / message | network | - | +| image | 缺省图片类型,支持传入图片 URL | string | search / network / content / collect / comment / halo / message | network | - | +| image-size | 图片大小,默认单位为 `px` | `string`/`number` | - | - | - | | tip | 提示文案 | string | - | - | - | diff --git a/src/pages/statusTip/Index.vue b/src/pages/statusTip/Index.vue index a5706b24..8f1e3185 100644 --- a/src/pages/statusTip/Index.vue +++ b/src/pages/statusTip/Index.vue @@ -1,31 +1,39 @@ diff --git a/src/uni_modules/wot-design-uni/components/wd-status-tip/index.scss b/src/uni_modules/wot-design-uni/components/wd-status-tip/index.scss index eeced241..e69ead25 100644 --- a/src/uni_modules/wot-design-uni/components/wd-status-tip/index.scss +++ b/src/uni_modules/wot-design-uni/components/wd-status-tip/index.scss @@ -17,12 +17,15 @@ color: $-statustip-color; font-size: $-statustip-fs; box-sizing: border-box; + display: flex; + flex-direction: column; + align-items: center; @include e(image) { margin: 0 auto; display: block; - width: 300px; - height: 200px; + width: 160px; + height: 160px; } @include e(text) { margin: 20px auto 0; diff --git a/src/uni_modules/wot-design-uni/components/wd-status-tip/wd-status-tip.vue b/src/uni_modules/wot-design-uni/components/wd-status-tip/wd-status-tip.vue index 353c62ea..ee626863 100644 --- a/src/uni_modules/wot-design-uni/components/wd-status-tip/wd-status-tip.vue +++ b/src/uni_modules/wot-design-uni/components/wd-status-tip/wd-status-tip.vue @@ -1,17 +1,17 @@