CardStatisticsWithIcon.vue
1.23 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
<script setup>
const props = defineProps({
title: {
type: String,
required: true,
},
value: {
type: String,
required: true,
},
change: {
type: Number,
required: true,
},
desc: {
type: String,
required: true,
},
icon: {
type: String,
required: true,
},
iconColor: {
type: String,
required: true,
},
})
</script>
<template>
<VCard>
<VCardText>
<div class="d-flex justify-space-between">
<div class="d-flex flex-column gap-y-1">
<div class="text-body-1 text-high-emphasis">
{{ title }}
</div>
<div>
<h5 class="text-h5">
{{ value }}
<span
class="text-base"
:class="change > 0 ? 'text-success' : 'text-error'"
>({{ prefixWithPlus(change) }}%)</span>
</h5>
</div>
<div class="text-body-2">
{{ desc }}
</div>
</div>
<VAvatar
:color="iconColor"
variant="tonal"
rounded
size="42"
>
<VIcon
:icon="icon"
size="26"
/>
</VAvatar>
</div>
</VCardText>
</VCard>
</template>