2022-01-07 01:17:26 +00:00
|
|
|
<template>
|
2022-01-10 03:28:09 +00:00
|
|
|
<nuxt-link
|
2022-01-10 04:33:09 +00:00
|
|
|
class="tab flex-grow text-center text-2xl font-semibold py-1 cursor-pointer rounded-tl-lg rounded-tr-lg"
|
|
|
|
:class="[colorClasses, index < 5 && 'mr-px', active && 'active']"
|
2022-01-10 03:28:09 +00:00
|
|
|
:to="tabData.route"
|
2022-01-07 01:17:26 +00:00
|
|
|
>
|
2022-01-08 23:42:22 +00:00
|
|
|
<template v-if="!tabData.locked">
|
|
|
|
<span :class="tabData.label" />
|
|
|
|
</template>
|
|
|
|
<template v-if="tabData.locked">
|
|
|
|
<span class="fas fa-lock" />
|
|
|
|
</template>
|
2022-01-10 03:28:09 +00:00
|
|
|
</nuxt-link>
|
2022-01-07 01:17:26 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
index: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
tabData: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
active() {
|
2022-01-10 03:28:09 +00:00
|
|
|
return this.$route.path === this.tabData.route
|
2022-01-07 01:17:26 +00:00
|
|
|
},
|
|
|
|
colorClasses() {
|
2022-01-10 03:28:09 +00:00
|
|
|
const { lightColor, darkColor } = this.tabData
|
|
|
|
|
2022-01-07 01:17:26 +00:00
|
|
|
return this.active
|
2022-01-10 03:28:09 +00:00
|
|
|
? `bg-${lightColor} text-${darkColor}`
|
|
|
|
: `bg-${darkColor} text-${lightColor}`
|
2022-01-07 01:17:26 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
2022-01-10 04:33:09 +00:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.active {
|
|
|
|
box-shadow: 3px 28px 9px -5px #000, 3px -1px 9px -4px #000;
|
|
|
|
}
|
|
|
|
</style>
|