2020-03-12 14:29:21 +01:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<li :class="{ active: sectionActive }">
|
|
|
|
<router-link v-if="menuSection.to" :to="menuSection.to">{{ menuSection.title }}</router-link>
|
|
|
|
<b v-else>{{ menuSection.title }}</b>
|
|
|
|
<ul>
|
|
|
|
<setting-menu-item :menu-item="item" v-for="item in menuSection.items" :key="item.title" />
|
|
|
|
</ul>
|
|
|
|
</li>
|
2020-03-12 14:29:21 +01:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
|
|
import { ISettingMenuSection } from "@/types/setting-menu.model";
|
|
|
|
import SettingMenuItem from "@/components/Settings/SettingMenuItem.vue";
|
2020-03-12 14:29:21 +01:00
|
|
|
@Component({
|
|
|
|
components: { SettingMenuItem },
|
|
|
|
})
|
|
|
|
export default class SettingMenuSection extends Vue {
|
|
|
|
@Prop({ required: true, type: Object }) menuSection!: ISettingMenuSection;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
get sectionActive(): boolean | undefined {
|
|
|
|
return (
|
|
|
|
this.menuSection.items &&
|
|
|
|
this.menuSection.items.some(({ to }) => to && to.name === this.$route.name)
|
|
|
|
);
|
2020-03-12 14:29:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
@import "@/variables.scss";
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
li {
|
|
|
|
font-size: 1.3rem;
|
|
|
|
background-color: $secondary;
|
2020-06-17 15:54:24 +02:00
|
|
|
color: $background-color;
|
2020-02-18 08:57:00 +01:00
|
|
|
margin: 2px auto;
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
&.active {
|
|
|
|
background-color: #fea72b;
|
|
|
|
}
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
a,
|
|
|
|
b {
|
|
|
|
cursor: pointer;
|
|
|
|
margin: 5px 0;
|
|
|
|
display: block;
|
|
|
|
padding: 5px 10px;
|
|
|
|
color: inherit;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|