This repository has been archived on 2024-03-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
timekeeper/components/GameTab.vue
2022-01-07 12:43:47 -08:00

34 lines
708 B
Vue

<template>
<div
class="tab flex-grow text-center text-2xl font-semibold py-1 cursor-pointer"
:class="[colorClasses, index < 5 && 'mr-px']"
@click="$store.commit('setActiveTab', index)"
>
{{ tabData.label }}
</div>
</template>
<script>
export default {
props: {
index: {
type: Number,
required: true,
},
tabData: {
type: Object,
required: true,
},
},
computed: {
active() {
return this.$store.state.activeTabIndex === this.index
},
colorClasses() {
return this.active
? this.$store.getters.activeColorClasses(this.index)
: this.$store.getters.inactiveColorClasses(this.index)
},
},
}
</script>