2023-05-29 07:05:29 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
2023-09-25 19:11:55 +00:00
|
|
|
@layer primevue {
|
|
|
|
.p-breadcrumb {
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-breadcrumb .p-breadcrumb-list {
|
|
|
|
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;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-breadcrumb .p-menuitem-separator {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-breadcrumb::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
2023-05-29 07:05:29 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: 'p-breadcrumb p-component',
|
|
|
|
menu: 'p-breadcrumb-list',
|
|
|
|
home: 'p-breadcrumb-home',
|
|
|
|
separator: 'p-menuitem-separator',
|
2023-05-30 09:59:17 +00:00
|
|
|
menuitem: ({ instance }) => ['p-menuitem', { 'p-disabled': instance.disabled() }],
|
2023-05-30 12:02:59 +00:00
|
|
|
action: ({ props, isActive, isExactActive }) => [
|
2023-05-29 07:05:29 +00:00
|
|
|
'p-menuitem-link',
|
|
|
|
{
|
2023-05-29 11:13:36 +00:00
|
|
|
'router-link-active': isActive,
|
2023-05-30 12:02:59 +00:00
|
|
|
'router-link-active-exact': props.exact && isExactActive
|
2023-05-29 07:05:29 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
icon: 'p-menuitem-icon',
|
|
|
|
label: 'p-menuitem-text'
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:20:35 +00:00
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'breadcrumb', manual: true });
|
2023-05-29 07:05:29 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseBreadcrumb',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
model: {
|
|
|
|
type: Array,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
home: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
exact: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
css: {
|
2023-05-30 09:59:17 +00:00
|
|
|
classes,
|
|
|
|
loadStyle
|
2023-05-29 07:05:29 +00:00
|
|
|
},
|
2023-05-30 09:59:17 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-29 07:05:29 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|