aboutsummaryrefslogtreecommitdiff
path: root/packages/client/src/components/BaseBreadcrumb.vue
blob: f1bf441f8180edf08e1db86aaa1dd8deeeb94138 (plain)
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
<template>
	<nav aria-label="breadcrumb">
		<ol class="breadcrumb">
			<li
				v-for="(item, index) in items" class="breadcrumb-item"
				:key="index">
				<router-link :to="item.path">
					{{ item.name }}
				</router-link>
			</li>
			<li class="breadcrumb-item active" aria-current="page">
				{{ activeItem }}
			</li>
		</ol>
	</nav>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
	name: "BaseBreadcrumb",
	props: {
		items: {
			type: Array,
			required: true
		},
		activeItem: {
			type: String,
			required: true
		}
	}
});
</script>

<style lang="scss" scoped>
@use "../scss/colors";

.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	padding: 0 0;
	margin-bottom: 1rem;
	list-style: none;
	a {
		color: colors.$text;
		text-decoration: none;
	}
	.active {
		color: #6c757d;
	}
	.breadcrumb-item {
		padding-left: 0.5rem;
		+ .breadcrumb-item::before {
			float: left;
			padding-right: 0.5rem;
			color: #6c757d;
			content: "/";
		}
	}
}
</style>