Initial commit from monorepo
This commit is contained in:
31
app/components/ui/SegmentedControl.vue
Normal file
31
app/components/ui/SegmentedControl.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div role="tablist" class="tabs tabs-boxed">
|
||||
<button
|
||||
v-for="option in options"
|
||||
:key="option.value"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="tab"
|
||||
:class="{ 'tab-active': modelValue === option.value }"
|
||||
@click="$emit('update:modelValue', option.value)"
|
||||
>
|
||||
{{ option.label }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
interface Option {
|
||||
value: string
|
||||
label: string
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
modelValue: string
|
||||
options: Option[]
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
(e: 'update:modelValue', value: string): void
|
||||
}>()
|
||||
</script>
|
||||
Reference in New Issue
Block a user