Files
frontend/app/components/PathBreadcrumb.vue
2026-08-21 15:29:01 +02:00

21 lines
579 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<span class="truncate">
<template v-for="(dir, i) in segments.dirs" :key="i">
<span class="text-muted">{{ dir }}</span><span class="mx-1.5 text-[17px] font-semibold text-text">›</span>
</template>
<span class="font-semibold text-text">{{ segments.file }}</span>
</span>
</template>
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps<{ path: string }>()
const segments = computed(() => {
const parts = props.path.split('/')
const file = parts.pop() ?? props.path
return { dirs: parts, file }
})
</script>