Add intro for text field

This commit is contained in:
philipp lang 2024-09-12 11:10:01 +02:00
parent 54efebf12e
commit a4a2a2b3fd
2 changed files with 26 additions and 18 deletions

View File

@ -1,5 +1,5 @@
<template>
<v-text type="text" :required="field.required" :name="field.key" :label="field.name" :id="field.key" :hint="field.hint" v-model="inner"></v-text>
<v-text type="text" :required="field.required" :name="field.key" :label="field.name" :id="field.key" :hint="field.hint" :intro="field.intro" v-model="inner"></v-text>
</template>
<script setup>

View File

@ -1,4 +1,6 @@
<template>
<div>
<div class="text-sm text-gray-600 mb-4" v-text="intro" v-if="intro"></div>
<label class="w-full border border-solid border-gray-500 focus-within:border-primary rounded-lg relative flex">
<input
:id="id"
@ -16,6 +18,7 @@
</div>
<field-label :name="label" :required="required"></field-label>
</label>
</div>
</template>
<script setup>
@ -70,6 +73,11 @@ const props = defineProps({
validator: (value) => value === null || typeof value === 'string',
default: () => null,
},
intro: {
required: false,
validator: (value) => value === null || typeof value === 'string',
default: () => null,
},
});
const presentMax = computed(() => {