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

79 lines
1.9 KiB
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
2023-04-26 09:57:16 +00:00
<nav class="p-breadcrumb p-component" v-bind="ptm('root')">
<ol class="p-breadcrumb-list" v-bind="ptm('menu')">
<BreadcrumbItem v-if="home" :item="home" class="p-breadcrumb-home" :templates="$slots" :exact="exact" :pt="pt" />
2023-01-20 21:11:14 +00:00
<template v-for="(item, i) of model" :key="item.label">
2023-04-26 09:57:16 +00:00
<li v-if="home || i !== 0" class="p-menuitem-separator" v-bind="ptm('separator')">
<slot name="separator">
2023-04-26 09:57:16 +00:00
<ChevronRightIcon aria-hidden="true" v-bind="ptm('separatorIcon')" />
</slot>
2022-12-08 11:04:25 +00:00
</li>
2023-04-26 09:57:16 +00:00
<BreadcrumbItem :item="item" :templates="$slots" :exact="exact" :pt="pt" />
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>
2023-04-26 09:57:16 +00:00
import BaseComponent from 'primevue/basecomponent';
import ChevronRightIcon from 'primevue/icons/chevronright';
2022-09-06 12:03:37 +00:00
import BreadcrumbItem from './BreadcrumbItem.vue';
export default {
name: 'Breadcrumb',
2023-04-26 09:57:16 +00:00
extends: BaseComponent,
2022-09-06 12:03:37 +00:00
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>