mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Co-authored-by: Alina Beck <alina.beck@mail.com> Co-authored-by: kachulio1 <jngugi88@gmail.com>
52 lines
917 B
Vue
52 lines
917 B
Vue
<template>
|
|
<ul class="tabs">
|
|
<li
|
|
v-for="tab in tabs"
|
|
:key="tab.type"
|
|
:class="[activeTab === tab.type && '--active', '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">
|
|
.tabs {
|
|
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;
|
|
}
|
|
|
|
&:hover:not(.--active) {
|
|
background: $color-neutral-85;
|
|
}
|
|
}
|
|
}
|
|
</style>
|