allow to make form field optional

This commit is contained in:
Alex Turchyn
2023-06-20 00:24:39 +03:00
parent 24380784a0
commit 4094bb03b7
12 changed files with 127 additions and 32 deletions
+20
View File
@@ -44,8 +44,28 @@
@focus="onNameFocus"
@blur="onNameBlur"
>{{ field.name || defaultName }}</span>
<div
v-if="isNameFocus"
class="flex items-center ml-1.5"
>
<input
:id="`required-checkbox-${field.uuid}`"
v-model="field.required"
type="checkbox"
class="checkbox checkbox-xs no-animation rounded"
@mousedown.prevent
>
<label
:for="`required-checkbox-${field.uuid}`"
class="label text-xs"
@click.prevent="field.required = !field.required"
@mousedown.prevent
>Required</label>
</div>
<button
v-else
class="pr-1"
title="Remove"
@click.prevent="$emit('remove')"
>
<IconX width="14" />