From 8c665523e3e2e3672e43f851412fbebe660678e5 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 29 Nov 2021 11:54:39 +0100 Subject: [PATCH] refactor(forms): simplify form field list (#207) --- docs/frontend/forms.md | 2 +- .../T3CeFormFormframework.vue | 3 +- .../T3FormFieldList/T3FormFieldList.vue | 33 ++++++++----------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/docs/frontend/forms.md b/docs/frontend/forms.md index bbc3e7ab..7511170c 100644 --- a/docs/frontend/forms.md +++ b/docs/frontend/forms.md @@ -206,7 +206,7 @@ This template will be suitable for most regular input elements. You can use this
::: -All fields are generated in the loop, based on T3Form schema. T3FormFormFramework component is responsible +All fields are generated in the loop, based on T3Form schema. T3FormFormFramework component is responsible for mapping fields to this strategy. ```json diff --git a/lib/components/T3CeFormFormframework/T3CeFormFormframework.vue b/lib/components/T3CeFormFormframework/T3CeFormFormframework.vue index 44d8ccbb..d4e15f68 100644 --- a/lib/components/T3CeFormFormframework/T3CeFormFormframework.vue +++ b/lib/components/T3CeFormFormframework/T3CeFormFormframework.vue @@ -59,8 +59,7 @@ export default { }, computed: { elements () { - const elements = [...this.form.elements] - return this.prepareElements(elements) + return this.prepareElements(this.form.elements) } }, created () { diff --git a/lib/components/T3Form/T3FormFieldList/T3FormFieldList.vue b/lib/components/T3Form/T3FormFieldList/T3FormFieldList.vue index 1662c9f2..6a95c99a 100644 --- a/lib/components/T3Form/T3FormFieldList/T3FormFieldList.vue +++ b/lib/components/T3Form/T3FormFieldList/T3FormFieldList.vue @@ -5,27 +5,20 @@ :key="field.identifier" :class="[`t3-form-field-${field.identifier}`, getCssClass(field, classes)]" > - - +