File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
uni_modules/wot-design-uni/components/wd-status-tip Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 5454<wd-status-tip image =" https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg" tip =" 查看我的头像" />
5555```
5656
57+ ## 自定义图片内容
58+
59+ 使用插槽 ` image ` 可以自定义图片内容。
60+
61+ ``` html
62+ <wd-status-tip tip =" 自定义图片内容" >
63+ <template #image >
64+ <wd-icon name =" ie-filled" size =" 100px" ></wd-icon >
65+ </template >
66+ </wd-status-tip >
67+ ```
68+
5769## Attributes
5870
5971| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
7082| ------ | ------------------------- | ---------------- | ------ | ------ | -------- |
7183| height | 图片高度,默认单位为 ` px ` | string \| number | - | - | 1.2.12 |
7284| width | 图片宽度,默认单位为 ` px ` | string \| number | - | - | 1.2.12 |
85+
86+ ## Slot
87+
88+ | name | 说明 | 最低版本 |
89+ | ------- | ------------------------ | -------- |
90+ | image | 图片内容 | $LOWEST_VERSION$ |
Original file line number Diff line number Diff line change 4242 <demo-block title =" 自定义图片" >
4343 <wd-status-tip image =" https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg" tip =" 查看我的头像" />
4444 </demo-block >
45+
46+ <demo-block title =" 插槽自定义图片内容" >
47+ <wd-status-tip tip =" 插槽自定义图片内容" >
48+ <template #image >
49+ <wd-icon name =" ie-filled" size =" 100px" ></wd-icon >
50+ </template >
51+ </wd-status-tip >
52+ </demo-block >
4553 </page-wraper >
4654</template >
4755<script lang="ts" setup></script >
Original file line number Diff line number Diff line change 11<!--
22 * @Author: weisheng
33 * @Date: 2023-06-12 10:04:19
4- * @LastEditTime: 2024-09-19 14:44:17
5- * @LastEditors: weisheng
4+ * @LastEditTime: 2024-09-20 10:23:38
5+ * @LastEditors: jiaoxueyan
66 * @Description:
77 * @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-status-tip\wd-status-tip.vue
88 * 记得注释
99-->
1010<template >
1111 <view :class =" `wd-status-tip ${customClass}`" :style =" customStyle" >
12- <wd-img v-if =" imgUrl" :mode =" imageMode" :src =" imgUrl" custom-class =" wd-status-tip__image" :custom-style =" imgStyle" ></wd-img >
12+ <slot name =" image" v-if =" $slots.image" ></slot >
13+ <wd-img v-else-if =" imgUrl" :mode =" imageMode" :src =" imgUrl" custom-class =" wd-status-tip__image" :custom-style =" imgStyle" ></wd-img >
1314 <view v-if =" tip" class =" wd-status-tip__text" >{{ tip }}</view >
1415 </view >
1516</template >
You can’t perform that action at this time.
0 commit comments