Jonathan Druart
5d6de5d437
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
31 lines
No EOL
890 B
Vue
31 lines
No EOL
890 B
Vue
<template>
|
|
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
|
|
<ol>
|
|
<li v-for="(item, counter) in breadCrumbs" v-bind:key="counter">
|
|
<router-link
|
|
v-if="!item.path && counter == breadCrumbs.length - 1"
|
|
:to="`${currentRoute}`"
|
|
>
|
|
{{ $__(item.text) }}</router-link
|
|
>
|
|
<router-link v-else :to="item.path">
|
|
{{ $__(item.text) }}</router-link
|
|
>
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
</template>
|
|
|
|
<script>
|
|
import { useRouter } from 'vue-router'
|
|
export default {
|
|
computed: {
|
|
breadCrumbs() {
|
|
if (this.$route.meta.breadcrumb) {
|
|
return this.$route.meta.breadcrumb()
|
|
}
|
|
},
|
|
currentRoute() { return this.$route.path }
|
|
},
|
|
};
|
|
</script> |