diff --git a/index.html b/index.html index 7b5a14f..9621db1 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,9 @@ style="--primary: yellow; --secondary: green; --font: #ff6600; --circle: #111111" value='{"sections": [ {"name": "Personal", "intro": "Jaöaöd", "fields": [ - {"name": "Vorname", "columns": {"mobile": 2, "tablet": 3, "desktop": 6}, "default": "", "required": true}, - {"name": "Nachname", "columns": {"mobile": 2, "tablet": 3, "desktop": 6}, "default": "", "required": true} + {"name": "Vorname", "type": "text", "columns": {"mobile": 2, "tablet": 3, "desktop": 6}, "default": "", "required": true}, + {"name": "Geschlecht", "type": "select", "columns": {"mobile": 2, "tablet": 3, "desktop": 6}, "default": null, "required": true, "options": ["A","Bb","Cc"]}, + {"name": "Nachname", "type": "text", "columns": {"mobile": 2, "tablet": 3, "desktop": 6}, "default": "", "required": true} ]}, {"name": "Veranstaltung", "intro": "Jaöaöd", "fields": [ ]}, diff --git a/src/Eventform.ce.vue b/src/Eventform.ce.vue index 8bb6cbf..df052d4 100644 --- a/src/Eventform.ce.vue +++ b/src/Eventform.ce.vue @@ -107,7 +107,10 @@ const v = computed(() => JSON.parse(props.value)); const {back, next, backable, nextable} = useNav(active, v.value.sections.length); function resolveComponentName(field) { - return FieldText; + return { + text: FieldText, + select: FieldSelect, + }[field.type]; } function generateDefaultValues() {