| 1234567891011121314151617181920212223 |
- <template>
- <a-breadcrumb >
- <a-breadcrumb-item v-for="item in breadcrumbs" :key="item.path" >
- <a :href="item.path">{{item.name}}</a>
- </a-breadcrumb-item>
- </a-breadcrumb>
- </template>
- <script lang="ts" setup >
- import { computed } from 'vue'
- import { useRoute } from 'vue-router'
- import { routes } from '@/router/'
- const route = useRoute()
- console.log('route.matched:', route)
- const breadcrumbs = computed(() => {
- return route.matched.map((route) => ({
- path: route.path,
- name: route.name
- }))
- })
- </script>
|