Bug 32030: Remove 'this' from template
[srvgit] / koha-tmpl / intranet-tmpl / prog / js / vue / components / ERM / Breadcrumb.vue
1 <template>
2     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
3         <ol>
4             <li v-for="(item, counter) in breadCrumbs" v-bind:key="counter">
5                 <router-link
6                     v-if="!item.path && counter == breadCrumbs.length - 1"
7                     :to="`${currentRoute}`"
8                 >
9                     {{ $t(item.text) }}</router-link
10                 >
11                 <router-link v-else :to="item.path">
12                     {{ $t(item.text) }}</router-link
13                 >
14             </li>
15         </ol>
16     </nav>
17 </template>
18
19 <script>
20 import { useRouter } from 'vue-router'
21 export default {
22     computed: {
23         breadCrumbs() {
24             if (this.$route.meta.breadcrumb) {
25                 return this.$route.meta.breadcrumb()
26             }
27         },
28         currentRoute: () => useRouter().currentRoute.value.path
29     },
30 };
31 </script>