gradido/frontend/src/components/Inputs/LabeledInput.vue
2025-02-06 16:18:32 +01:00

33 lines
588 B
Vue

<template>
<div :class="wrapperClassName">
<BFormGroup :label="label" :label-for="labelFor">
<BFormInput
v-bind="$attrs"
/>
<slot></slot>
</BFormGroup>
</div>
</template>
<script setup>
import { computed, defineOptions } from 'vue'
defineOptions({
inheritAttrs: false,
})
const props = defineProps({
label: {
type: String,
required: true,
},
name: {
type: String,
required: true,
},
})
const wrapperClassName = computed(() => `input-${props.name}`)
const labelFor = computed(() => `${props.name}-input-field`)
</script>