optimize form render with many fields

This commit is contained in:
Pete Matsyburka
2023-12-31 17:23:27 +02:00
parent fd4e15003a
commit f358f24abb
5 changed files with 46 additions and 13 deletions
+10 -3
View File
@@ -326,18 +326,25 @@
:can-send-email="canSendEmail && !!submitter.email"
:submitter-slug="submitterSlug"
/>
<div class="flex justify-center">
<div class="flex items-center mt-5 mb-1">
<div
v-if="stepFields.length < 80"
class="flex justify-center"
>
<div class="flex items-center mt-4 mb-1 flex-wrap">
<a
v-for="(step, index) in stepFields"
:key="step[0].uuid"
href="#"
class="inline border border-base-300 h-3 w-3 rounded-full mx-1"
class="inline border border-base-300 h-3 w-3 rounded-full mx-1 mt-1"
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': (index < currentStep && stepFields[index].every((f) => !f.required || ![null, undefined, ''].includes(values[f.uuid]))) || isCompleted, 'bg-white': index > currentStep }"
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(step, true)]"
/>
</div>
</div>
<div
v-else
class="mt-5"
/>
</div>
</div>
</template>