Skip to content

Commit 8d528cb

Browse files
authored
fix: 🐛 修复Card footer或者header没写的时候,不会自动隐藏占位
1 parent dbd2c85 commit 8d528cb

2 files changed

Lines changed: 52 additions & 4 deletions

File tree

src/pages/card/Index.vue

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!--
22
* @Author: weisheng
33
* @Date: 2023-06-13 11:47:12
4-
* @LastEditTime: 2023-08-11 18:49:11
5-
* @LastEditors: weisheng
4+
* @LastEditTime: 2025-01-10 14:52:40
5+
* @LastEditors: 810505339
66
* @Description:
77
* @FilePath: \wot-design-uni\src\pages\card\Index.vue
88
* 记得注释
@@ -36,6 +36,49 @@
3636
</template>
3737
</wd-card>
3838
</demo-block>
39+
<demo-block title="去除footer" transparent>
40+
<wd-card title="网名" type="rectangle">
41+
<view>
42+
<image
43+
src="https://avatars.githubusercontent.com/u/26426873?v=4"
44+
alt="joy"
45+
style="width: 40px; height: 40px; border-radius: 4px; margin-right: 12px"
46+
/>
47+
大家好,我叫摸鱼
48+
</view>
49+
</wd-card>
50+
<wd-card type="rectangle">
51+
<template #title>
52+
<view class="title">
53+
<view>2020-02-03服务到期</view>
54+
<view class="title-tip">
55+
<wd-icon name="warning" size="14px" custom-style="vertical-align: bottom" />
56+
您可以去电脑上使用该服务
57+
</view>
58+
</view>
59+
</template>
60+
61+
<view style="height: 40px" class="content">
62+
<image
63+
src="https://img11.360buyimg.com/imagetools/jfs/t1/143248/37/5695/265818/5f3a8546E98d998a4/745897ca9c9e474b.jpg"
64+
width="40"
65+
height="40"
66+
alt="joy"
67+
style="width: 40px; height: 40px; border-radius: 4px; margin-right: 12px"
68+
/>
69+
<view>
70+
<view class="custom-main">智云好客CRM短信_催评营销</view>
71+
<view class="custom-sub">高级版-快速吸粉 | 周期一年</view>
72+
</view>
73+
</view>
74+
<template #footer>
75+
<view>
76+
<wd-button size="small" plain custom-style="margin-right: 8px">评价</wd-button>
77+
<wd-button size="small">立即使用</wd-button>
78+
</view>
79+
</template>
80+
</wd-card>
81+
</demo-block>
3982
<demo-block title="矩形卡片" transparent>
4083
<wd-card title="2020-02-03服务到期" type="rectangle">
4184
<view style="height: 40px" class="content">
@@ -103,6 +146,7 @@
103146
.custom-main {
104147
color: $-dark-color;
105148
}
149+
106150
.custom-sub {
107151
color: $-dark-color-gray;
108152
}
@@ -115,12 +159,15 @@
115159
justify-content: flex-start;
116160
align-items: center;
117161
}
162+
118163
.content {
119164
justify-content: flex-start;
120165
}
166+
121167
.title {
122168
justify-content: space-between;
123169
}
170+
124171
.title-tip {
125172
color: rgba(0, 0, 0, 0.25);
126173
font-size: 12px;
@@ -130,6 +177,7 @@
130177
color: rgba(0, 0, 0, 0.85);
131178
font-size: 16px;
132179
}
180+
133181
.custom-sub {
134182
color: rgba(0, 0, 0, 0.25);
135183
font-size: 12px;

src/uni_modules/wot-design-uni/components/wd-card/wd-card.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view :class="['wd-card', type == 'rectangle' ? 'is-rectangle' : '', customClass]" :style="customStyle">
3-
<view :class="['wd-card__title-content', customTitleClass]">
3+
<view :class="['wd-card__title-content', customTitleClass]" v-if="title || $slots.title">
44
<view class="wd-card__title">
55
<text v-if="title">{{ title }}</text>
66
<slot v-else name="title"></slot>
@@ -9,7 +9,7 @@
99
<view :class="`wd-card__content ${customContentClass}`">
1010
<slot></slot>
1111
</view>
12-
<view :class="`wd-card__footer ${customFooterClass}`">
12+
<view :class="`wd-card__footer ${customFooterClass}`" v-if="$slots.footer">
1313
<slot name="footer"></slot>
1414
</view>
1515
</view>

0 commit comments

Comments
 (0)