-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPageBreadcrumb.vue
35 lines (32 loc) · 1 KB
/
PageBreadcrumb.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
<script setup lang="ts">
import type { PropType } from 'vue'
import type { BreadcrumbItem } from '~/types'
defineProps({
/**
* Breadcrumb items
*
* @type { BreadcrumbItem[] }
*/
items: {
type: Array as PropType<BreadcrumbItem[]>,
default: () => [],
},
})
const { t } = useI18n()
</script>
<template>
<nav class="hidden md:flex mb-10" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-3">
<li class="inline-flex items-center">
<Link href="/" class="inline-flex items-center text-normal font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white">
<Icon icon="bi:house-heart-fill" /> {{ t('home') }}
</Link>
</li>
<li v-for="item in items" :key="item.text" :aria-current="item.active ? 'page' : undefined">
<PageBreadcrumbItem v-bind="{ path: item.path, active: item.active }">
{{ item.text }}
</PageBreadcrumbItem>
</li>
</ol>
</nav>
</template>