This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VBreadcrumbs/VBreadcrumbs.js
2019-08-11 20:48:02 +02:00

69 lines
No EOL
1.5 KiB
JavaScript

// Styles
import "../../../src/components/VBreadcrumbs/VBreadcrumbs.sass"; // Components
import { VBreadcrumbsDivider, VBreadcrumbsItem } from '.'; // Mixins
import Themeable from '../../mixins/themeable'; // Utils
import mixins from '../../util/mixins';
export default mixins(Themeable
/* @vue/component */
).extend({
name: 'v-breadcrumbs',
props: {
divider: {
type: String,
default: '/'
},
items: {
type: Array,
default: () => []
},
large: Boolean
},
computed: {
classes() {
return {
'v-breadcrumbs--large': this.large,
...this.themeClasses
};
}
},
methods: {
genDivider() {
return this.$createElement(VBreadcrumbsDivider, this.$slots.divider ? this.$slots.divider : this.divider);
},
genItems() {
const items = [];
const hasSlot = !!this.$scopedSlots.item;
const keys = [];
for (let i = 0; i < this.items.length; i++) {
const item = this.items[i];
keys.push(item.text);
if (hasSlot) items.push(this.$scopedSlots.item({
item
}));else items.push(this.$createElement(VBreadcrumbsItem, {
key: keys.join('.'),
props: item
}, [item.text]));
if (i < this.items.length - 1) items.push(this.genDivider());
}
return items;
}
},
render(h) {
const children = this.$slots.default || this.genItems();
return h('ul', {
staticClass: 'v-breadcrumbs',
class: this.classes
}, children);
}
});
//# sourceMappingURL=VBreadcrumbs.js.map