-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
81 lines (77 loc) · 1.99 KB
/
App.vue
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
<template>
<div class="custom-content">
<vTimelineComponent
layout="vertical"
:events="timelineEvents"
line-width="4px"
color="#bf6a53"
>
<template #default="{ event }: { event: TimelineEvent, index: number }">
<p>{{ event.title }}</p>
<p>{{ event.description }}</p>
<p>{{ event.date }}</p>
</template>
<template #marker> 💩</template>
</vTimelineComponent>
<vTimelineComponent
layout="horizontal"
:events="timelineEvents"
line-width="2px"
color="#aa8ed6"
marker-size="1.2rem"
>
<template #default="{ event }: { event: TimelineEvent, index: number }">
<p>{{ event.title }}</p>
<p>{{ event.description }}</p>
<p>{{ event.date }}</p>
</template>
<template #marker="{ event }"> {{ event.marker }}</template>
</vTimelineComponent>
</div>
</template>
<script setup lang="ts">
import { ref, type Ref } from "vue";
import { vTimelineComponent } from "./index";
interface TimelineEvent {
title: string;
date: string;
description: string;
child?: TimelineEvent[];
}
const timelineEvents: Ref<TimelineEvent[]> = ref([
{
title: "Lorem ipsum dolor sit amet 0",
date: "2023-02-15",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
marker: "🥳",
},
{
title: "Lorem ipsum dolor sit amet 1",
date: "2023-03-01",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
marker: "🥴",
},
{
title: "Lorem ipsum dolor sit amet 2",
date: "2023-04-20",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
marker: "🐸",
},
{
title: "Lorem ipsum dolor sit amet 3",
date: "2023-01-20",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
marker: "🤫",
},
]);
</script>
<style scoped>
.custom-content {
position: relative;
margin-left: 10px;
}
.test {
background-color: red;
max-width: 8px;
}
</style>