Add intro for dropdown

This commit is contained in:
philipp lang 2024-06-10 16:51:21 +02:00
parent 3907395506
commit 3848b79d08
2 changed files with 44 additions and 27 deletions

View File

@ -1,5 +1,15 @@
<template>
<v-dropdown v-model="inner" :label="field.name" :id="innerId" :name="innerId" :options="innerOptions" :required="field.required" :hint="field.hint" :allowcustom="field.allowcustom"></v-dropdown>
<v-dropdown
v-model="inner"
:label="field.name"
:id="innerId"
:name="innerId"
:options="innerOptions"
:required="field.required"
:hint="field.hint"
:allowcustom="field.allowcustom"
:intro="field.intro"
></v-dropdown>
</template>
<script setup>

View File

@ -1,4 +1,6 @@
<template>
<div>
<div class="text-sm text-gray-600 pb-3" 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" :for="id">
<select
v-if="!allowcustom"
@ -25,6 +27,7 @@
</div>
<field-label :name="label" class="group-[.info]:bg-blue-200" :required="required"></field-label>
</label>
</div>
</template>
<script setup>
@ -68,6 +71,10 @@ const props = defineProps({
required: true,
type: Boolean,
},
intro: {
required: false,
default: () => '',
},
});
const inner = computed({