46 lines
974 B
Vue
46 lines
974 B
Vue
<template>
|
|
<div class="breadcrumbs">
|
|
<component
|
|
:is="element"
|
|
:to="base || ''"
|
|
:aria-label="t('files.home')"
|
|
:title="t('files.home')"
|
|
>
|
|
<AppIcon name="home" />
|
|
</component>
|
|
|
|
<span v-for="(link, index) in items" :key="index">
|
|
<span class="chevron"><AppIcon name="keyboard_arrow_right" /></span>
|
|
<component :is="element" :to="link.url">{{ link.name }}</component>
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from "vue";
|
|
import { breadcrumbItems } from "@/utils/breadcrumbs";
|
|
import { useI18n } from "vue-i18n";
|
|
import { useRoute } from "vue-router";
|
|
|
|
const { t } = useI18n();
|
|
|
|
const route = useRoute();
|
|
|
|
const props = defineProps<{
|
|
base: string;
|
|
noLink?: boolean;
|
|
}>();
|
|
|
|
const items = computed(() => breadcrumbItems(route.path, props.base));
|
|
|
|
const element = computed(() => {
|
|
if (props.noLink) {
|
|
return "span";
|
|
}
|
|
|
|
return "router-link";
|
|
});
|
|
</script>
|
|
|
|
<style></style>
|