Card.nvue
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
<view class="h-card" :style="{height:autoHeight?'':props.height,padding:cardPadding}">
<view class="h-card_title" v-if="props.title" :style="titleStyle">
<!-- // <text class="text">{{ props.title }}</text> -->
<uv-text bold :text="props.title" align="left" size="32rpx" color="#202328" :lines="1"></uv-text>
<image v-if="titleIcon" src="@/static/tabbar/h-title_bg.png" class="img" mode=""></image>
<slot name="filter" />
</view>
<view class="h-card_content" :style="autoHeight?'':'flex:1'">
<slot name="content" />
</view>
</view>
</template>
<script setup>
const props = defineProps({
title: {
type: String,
default: ''
},
cardPadding:{
type:String,
default: '28rpx'
},
autoHeight: {
type: Boolean,
default: false
},
height: {
type: String,
default: '506rpx'
},
titleIcon: {
type: Boolean,
default: false
},
titleStyle:{
type: Object,
default: () => ({
paddingLeft:0
})
}
})
</script>
<style lang="scss" scoped>
.h-card {
width: 710rpx;
background: #FFFFFF;
border-radius: 16rpx;
overflow: hidden;
display: flex;
flex-direction: column;
&_title {
display: flex;
flex-direction: column;
position: relative;
flex-direction: row;
justify-content: space-between;
.text {
color: #202328;
font-size: 32rpx;
font-family: PingFang_Bold;
line-height: 44rpx;
font-weight: bold;
flex:1;
}
.img {
width: 75px;
height: 10px;
position: absolute;
bottom: 6rpx;
left: 14rpx;
}
}
&_content{
min-height: 0;
}
}
</style>