primevue-mirror/components/lib/breadcrumb/Breadcrumb.vue

77 lines
1.7 KiB
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
2022-12-08 11:04:25 +00:00
<nav class="p-breadcrumb p-component">
<ol class="p-breadcrumb-list">
<BreadcrumbItem v-if="home" :item="home" class="p-breadcrumb-home" :templates="$slots" :exact="exact" />
2023-01-20 21:11:14 +00:00
<template v-for="(item, i) of model" :key="item.label">
2023-01-23 08:58:32 +00:00
<li v-if="home || i !== 0" class="p-menuitem-separator">
<slot name="separator">
<ChevronRightIcon aria-hidden="true" />
</slot>
2022-12-08 11:04:25 +00:00
</li>
<BreadcrumbItem :item="item" :templates="$slots" :exact="exact" />
2022-09-06 12:03:37 +00:00
</template>
2022-12-08 11:04:25 +00:00
</ol>
2022-09-06 12:03:37 +00:00
</nav>
</template>
<script>
import ChevronRightIcon from 'primevue/icon/chevronright';
2022-09-06 12:03:37 +00:00
import BreadcrumbItem from './BreadcrumbItem.vue';
export default {
name: 'Breadcrumb',
props: {
model: {
type: Array,
default: null
},
home: {
type: null,
default: null
},
exact: {
type: Boolean,
default: true
}
},
components: {
BreadcrumbItem: BreadcrumbItem,
ChevronRightIcon: ChevronRightIcon
2022-09-06 12:03:37 +00:00
}
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
</script>
<style>
.p-breadcrumb {
overflow-x: auto;
}
2022-12-08 11:04:25 +00:00
.p-breadcrumb .p-breadcrumb-list {
2022-09-06 12:03:37 +00:00
margin: 0;
padding: 0;
list-style-type: none;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
.p-breadcrumb .p-menuitem-text {
line-height: 1;
}
.p-breadcrumb .p-menuitem-link {
text-decoration: none;
2022-12-08 11:04:25 +00:00
display: flex;
align-items: center;
}
.p-breadcrumb .p-menuitem-separator {
display: flex;
align-items: center;
2022-09-06 12:03:37 +00:00
}
.p-breadcrumb::-webkit-scrollbar {
display: none;
}
</style>