explorer-app/components/Tabs.vue

36 lines
749 B
Vue
Raw Permalink Normal View History

2023-12-19 18:43:42 +01:00
<script lang="ts" setup>
import type { InputOption } from '~/types'
const props = defineProps<{
options: InputOption[]
modelValue: string | number
2023-12-19 18:43:42 +01:00
}>()
const emits = defineEmits(['update:modelValue'])
const selectedValue = useVModel(props, 'modelValue', emits)
</script>
<template>
<div
flex
items-center
gap-16px
>
<div
v-for="option in options"
:key="option.value"
:class="[selectedValue === option.value ? 'font-700 text-app-black bg-app-white' : 'font-400 text-app-white border-app-white']"
text-24px
leading-32px
px-16px
py-8px
border-2px
cursor-pointer
@click="selectedValue = option.value"
>
2023-12-19 18:43:42 +01:00
{{ option.label }}
</div>
</div>
</template>