<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item v-for="item in matched" :key="item.path" :to="{ path: item.path }">
      {{ item.meta?.name || item.name }}
    </el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const matched = computed(() => route.matched.filter((r) => r.meta?.name))
</script>

<style scoped>
:deep(.el-breadcrumb__inner) {
  cursor: default;
}
</style>
