Add empty option
This commit is contained in:
parent
af70e8654d
commit
9e30de968e
|
@ -9,7 +9,7 @@
|
|||
>
|
||||
<option :value="null">-- kein --</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>
|
||||
<option v-if="field.has_empty_option" :value="-1" v-text="field.empty_option_value"></option>
|
||||
</select>
|
||||
<field-label :name="field.name" :required="field.required"></field-label>
|
||||
</label>
|
||||
|
@ -28,9 +28,9 @@ const props = defineProps({
|
|||
field: {
|
||||
required: true,
|
||||
validator: (value) =>
|
||||
hasKeys(value, [...globalFieldRules(), 'required', 'parent_field', 'parent_group', 'empty_option', 'empty_option_value']) &&
|
||||
hasKeys(value, [...globalFieldRules(), 'required', 'parent_field', 'parent_group', 'has_empty_option', 'empty_option_value']) &&
|
||||
typeof value.required === 'boolean' &&
|
||||
typeof value.empty_option === 'boolean' &&
|
||||
typeof value.has_empty_option === 'boolean' &&
|
||||
typeof value.empty_option_value === 'string' &&
|
||||
typeof value.key === 'string' &&
|
||||
value.key.length > 0 &&
|
||||
|
|
Loading…
Reference in New Issue