Moriz Wahl a30ae12d65 specs added for SearchResults component.
General use of v-if instead of v-show. Why render a not displayed component?
Helper added to fake posts.
2020-05-12 18:30:26 +02:00

66 lines
1.2 KiB
Vue

<template>
<ul class="tab-navigation">
<li
v-for="tab in tabs"
:key="tab.type"
:class="[
activeTab === tab.type && '--active',
tab.disabled && '--disabled',
'tab',
tab.type + '-tab',
]"
role="button"
@click="$emit('switchTab', tab.type)"
>
{{ tab.title }}
</li>
</ul>
</template>
<script>
export default {
props: {
tabs: {
type: Array,
required: true,
},
activeTab: {
type: String,
},
},
}
</script>
<style lang="scss">
.tab-navigation {
display: flex;
margin-top: $space-small;
> .tab {
font-weight: $font-weight-bold;
padding: $space-x-small $space-small;
margin-right: $space-xx-small;
border-radius: $border-radius-base $border-radius-base 0 0;
background: $color-neutral-100;
cursor: pointer;
&.--active {
background: $color-neutral-80;
border: none;
}
&.--disabled {
background: $background-color-disabled;
border: $border-size-base solid $color-neutral-80;
border-bottom: none;
pointer-events: none;
cursor: default;
}
&:hover:not(.--active) {
background: $color-neutral-85;
}
}
}
</style>