Files
manja_ui_dev/Vue_Full_Project/src/components/Breadcrumb.vue
T
Łukasz Holeczek f244f02585 - Update Vue to 2.5.2
- Update Vue Router to 3.0.0
- Fix height and position problems with .fixed-footer
- Fix mobile sidebar height
- Fix mobile breadcrumb position with .fixed-breadcrumb
- Add new navbar toggler icon
- Update old bootstrap classes ex. `hidden-sm-down`
2017-10-16 16:08:00 +02:00

35 lines
701 B
Vue

<template>
<ol class="breadcrumb">
<li class="breadcrumb-item" v-for="(item, index) in list">
<span class="active" v-if="isLast(index)">{{ showName(item) }}</span>
<router-link :to="item" v-else>{{ showName(item) }}</router-link>
</li>
</ol>
</template>
<script>
export default {
props: {
list: {
type: Array,
required: true,
default: () => []
}
},
methods: {
isLast (index) {
return index === this.list.length - 1
},
showName (item) {
if (item.meta && item.meta.label) {
item = item.meta && item.meta.label
}
if (item.name) {
item = item.name
}
return item
}
}
}
</script>