2021-01-19 11:41:45 -08:00
|
|
|
<template>
|
2021-03-12 09:44:19 -08:00
|
|
|
<section>
|
|
|
|
<div class="d-none d-md-inline-flex btn-group btn-block mb-2 w-100">
|
|
|
|
<router-link v-for="{name, icon, route} in links" :key="name"
|
|
|
|
:to="buildRoute(route)"
|
|
|
|
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
|
|
|
|
<Icon :v="icon"/>
|
|
|
|
<T>nouns.{{name}}.header</T>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
<div class="d-block d-md-none btn-group-vertical btn-block mb-2 w-100">
|
|
|
|
<router-link v-for="{name, icon, route} in links" :key="name"
|
|
|
|
:to="buildRoute(route)"
|
|
|
|
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
|
|
|
|
<Icon :v="icon"/>
|
|
|
|
<T>nouns.{{name}}.header</T>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</section>
|
2021-01-19 11:41:45 -08:00
|
|
|
</template>
|
2021-03-12 09:44:19 -08:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
const links = [
|
|
|
|
{name: 'nouns', icon: 'book', route: ''},
|
|
|
|
];
|
|
|
|
|
2021-08-28 14:44:30 -07:00
|
|
|
if (this.config.inclusive.enabled) {
|
|
|
|
links.push({name: 'inclusive', icon: 'book-heart', route: this.config.inclusive.route});
|
2021-03-12 09:44:19 -08:00
|
|
|
}
|
|
|
|
|
2021-08-28 14:44:30 -07:00
|
|
|
if (this.config.terminology.enabled) {
|
|
|
|
links.push({name: 'terms', icon: 'flag', route: this.config.terminology.route});
|
2021-03-12 09:44:19 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
links,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
buildRoute(route) {
|
|
|
|
return `/${this.config.nouns.route}/${route}`;
|
|
|
|
},
|
|
|
|
isActiveRoute(route) {
|
|
|
|
return decodeURIComponent(this.$route.fullPath).replace(/\/$/, '') === this.buildRoute(route).replace(/\/$/, '');
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|