From 0618908c1bbd34e1ebc5b0158c35a791dca78646 Mon Sep 17 00:00:00 2001 From: TrendyTim Date: Thu, 25 Mar 2021 09:26:34 +1100 Subject: [PATCH 1/2] Added getFormValues to return FormSubmission.values() Gets the current value state (used for saving a draft version of the form in memory or for submitting that to server). --- src/FormulateForm.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FormulateForm.vue b/src/FormulateForm.vue index 15ae5dec..82007e00 100644 --- a/src/FormulateForm.vue +++ b/src/FormulateForm.vue @@ -225,6 +225,10 @@ export default { this.errorComponents.push(component) } }, + getFormValues() { + //return promise of Form values + return new FormSubmission(this).values(); + }, formSubmitted () { if (this.isLoading) { return undefined From 1d1699c5e745a02c030313295f68730f21173412 Mon Sep 17 00:00:00 2001 From: TrendyTim Date: Thu, 25 Mar 2021 09:36:53 +1100 Subject: [PATCH 2/2] change submit to return formSubmitted result Although one can bypass this by invoking formSubmitted on the instance itself, if more advanced needs are not required, is a seemingly innocious way to get the promise from the submission. --- src/Formulate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formulate.js b/src/Formulate.js index e12f6c6c..5621ecb4 100644 --- a/src/Formulate.js +++ b/src/Formulate.js @@ -403,7 +403,7 @@ class Formulate { */ submit (formName) { const form = this.registry.get(formName) - form.formSubmitted() + return form.formSubmitted() } /**