Update empty option in group

This commit is contained in:
philipp lang 2024-04-18 00:43:34 +02:00
parent 31b03b69ed
commit f6bac84273
1 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,7 @@
> >
<option :value="null">-- kein --</option> <option :value="null">-- kein --</option>
<option v-for="(option, index) in options" :key="index" :value="option.id" v-text="option.name"></option> <option v-for="(option, index) in options" :key="index" :value="option.id" v-text="option.name"></option>
<option v-if="field.empty_option" :value="-1" v-text="field.empty_option_value"></option>
</select> </select>
<field-label :name="field.name" :required="field.required"></field-label> <field-label :name="field.name" :required="field.required"></field-label>
</label> </label>
@ -27,8 +28,10 @@ const props = defineProps({
field: { field: {
required: true, required: true,
validator: (value) => validator: (value) =>
hasKeys(value, [...globalFieldRules(), 'required', 'parent_field', 'parent_group']) && hasKeys(value, [...globalFieldRules(), 'required', 'parent_field', 'parent_group', 'empty_option', 'empty_option_value']) &&
typeof value.required === 'boolean' && typeof value.required === 'boolean' &&
typeof value.empty_option === 'boolean' &&
typeof value.empty_option_value === 'string' &&
typeof value.key === 'string' && typeof value.key === 'string' &&
value.key.length > 0 && value.key.length > 0 &&
typeof value.name === 'string' && typeof value.name === 'string' &&