primevue-mirror/components/breadcrumb/Breadcrumb.vue

73 lines
1.5 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" :exact="exact" />
2022-09-06 12:03:37 +00:00
<template v-for="item of model" :key="item.label">
2022-12-08 11:04:25 +00:00
<li class="p-menuitem-separator">
<span class="pi pi-chevron-right" aria-hidden="true"></span>
</li>
2022-09-06 12:03:37 +00:00
<BreadcrumbItem :item="item" :template="$slots.item" :exact="exact" />
</template>
2022-12-08 11:04:25 +00:00
</ol>
2022-09-06 12:03:37 +00:00
</nav>
</template>
<script>
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: {
2022-09-14 11:26:01 +00:00
BreadcrumbItem: BreadcrumbItem
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>