diff --git a/src/EventForm.ce.vue b/src/EventForm.ce.vue index 7cb4399..55bf735 100644 --- a/src/EventForm.ce.vue +++ b/src/EventForm.ce.vue @@ -113,7 +113,7 @@ - + @@ -156,7 +156,7 @@ const {colClassesForField, containerClasses} = useColumns(); const finished = ref(false); const eventForm = ref(null); -const emits = defineEmits(['addSection', 'editSection', 'deleteSection', 'editField', 'deleteField', 'active']); +const emits = defineEmits(['addSection', 'editSection', 'deleteSection', 'editField', 'deleteField', 'active', 'save']); const props = defineProps({ editable: { @@ -179,6 +179,10 @@ const props = defineProps({ default: () => false, type: Boolean, }, + asForm: { + type: Boolean, + default: () => false, + }, }); const active = ref(0); @@ -227,6 +231,10 @@ const {back, next, backable, nextable} = useNav(active, v.value.sections.length) const {resolveComponentName} = useFields(); async function submit() { + if (props.asForm) { + emit('save', payload.value); + return; + } try { await axios.post('/api/form/' + props.formId + '/register', payload.value); finished.value = true; diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue index 86517b9..d6bb4d7 100644 --- a/src/components/Navigation.vue +++ b/src/components/Navigation.vue @@ -10,7 +10,7 @@
- Anmeldung absenden + @@ -29,6 +29,10 @@ const props = defineProps({ type: Number, required: true, }, + asForm: { + type: Boolean, + required: true, + }, }); const innerValue = computed({