simple-card.vue
1.3 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
<template>
<section
:class="
props.customClass.length > 0 ? `${props.customClass} card` : 'card'
"
>
<div class="header">
<div class="title" v-text="props.title" />
<div class="extend">
<slot name="extend" />
</div>
</div>
<div class="body">
<slot name="component" />
</div>
</section>
</template>
<script setup>
const props = defineProps({
title: {
type: String,
default: 'Title'
},
customClass: {
type: String,
default: ''
}
});
</script>
<style lang="less" scoped>
.card {
width: 222px;
padding: 12px 14px 12px 14px;
border-radius: 10px;
box-shadow: rgba(145, 153, 163, 0.16) 0px 1px 1px;
border: 1px solid rgb(205, 209, 213);
background-color: rgb(255, 255, 255);
color: black;
white-space: pre-wrap;
.header {
display: flex;
flex-direction: row;
-webkit-box-pack: justify;
justify-content: space-between;
margin-bottom: 16px;
height: 18px;
.title {
margin: 0px;
font-size: 16px;
line-height: 24px;
font-weight: 700;
}
.extend {
padding-left: 8px;
}
}
}
</style>