🎉 Init
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user