agola-web/src/components/projbreadcrumbs.vue

54 lines
1.3 KiB
Vue
Raw Normal View History

2018-12-09 13:21:20 +00:00
<template>
<nav class="breadcrumb" aria-label="breadcrumbs">
2018-12-09 13:21:20 +00:00
<ul>
<li>
<a>{{ownertype}}</a>
</li>
2018-12-09 13:21:20 +00:00
<li>
<router-link :to="ownerLink(ownertype, ownername)">{{ownername}}</router-link>
</li>
<li v-for="(ref, i) in projectref" v-bind:key="i">
<router-link
v-if="i+1 < projectref.length"
:to="projectGroupLink(ownertype, ownername, projectref.slice(0, i+1))"
>{{ref}}</router-link>
<router-link
v-else
:to="projectLink(ownertype, ownername, projectref.slice(0, i+1))"
>{{ref}}</router-link>
</li>
<li v-for="(ref, i) in projectgroupref" v-bind:key="i">
<router-link
:to="projectGroupLink(ownertype, ownername, projectgroupref.slice(0, i+1))"
>{{ref}}</router-link>
2018-12-09 13:21:20 +00:00
</li>
</ul>
</nav>
</template>
<script>
import { ownerLink, projectLink, projectGroupLink } from "@/util/link.js";
2018-12-09 13:21:20 +00:00
export default {
name: "projbreadcrumbs",
components: {},
props: {
ownertype: String,
ownername: String,
projectref: Array,
projectgroupref: Array
2018-12-09 13:21:20 +00:00
},
methods: {
ownerLink: ownerLink,
projectLink: projectLink,
projectGroupLink: projectGroupLink
2018-12-09 13:21:20 +00:00
}
};
</script>
<style scoped lang="scss">
@import "@/css/_variables.scss";
</style>