Files
apoena/src/components/design-system/form/FormInput.vue
2023-05-27 23:08:21 +02:00

30 lines
505 B
Vue

<script setup lang="ts">
defineProps<{
id: string
label: string
modelValue: string
}>()
defineEmits<{
(event: "update:modelValue", value: string): void
}>()
</script>
<template>
<div class="form-input">
<label :for="id">{{ label }}</label>
<input
type="text"
id="id"
:value="modelValue"
@input="$emit('update:modelValue', $event.target?.value ?? '')"
/>
</div>
</template>
<style scoped lang="scss">
.form-input {
display: flex;
gap: 1rem;
}
</style>