feat(frontend,api): Add checkbox and select

This commit is contained in:
2025-03-16 09:08:54 +01:00
parent 2e8e1d8e90
commit cb12e29966
5 changed files with 65 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
<template>
<UCheckbox v-model="modelValue" :label="label" />
</template>
<script setup lang="ts">
import type { FormOptionDto } from '~/.api-client'
const props = defineProps<{
formOptions: FormOptionDto[]
}>()
const emit = defineEmits<{
(e: 'update:formOptions', value: FormOptionDto[]): void
}>()
const modelValue = computed({
get: () => props.formOptions?.[0].value === 'true',
set: (val) => {
if (props.formOptions?.[0]) {
const updatedModelValue = [...props.formOptions]
updatedModelValue[0] = { ...updatedModelValue[0], value: val.toString() }
emit('update:formOptions', updatedModelValue)
}
}
})
const label = computed(() => props.formOptions?.[0].label ?? '')
</script>