From d1e1a2a36a1bd1ab6b3a1b4b8bc49654b95c4dce Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 7 Nov 2019 15:02:20 -0500 Subject: [PATCH] Update TO form and nested components to emit directly to parent components instead of emitting from the root component --- js/mixins/form.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/mixins/form.js b/js/mixins/form.js index 87f5a044..59d7d2f5 100644 --- a/js/mixins/form.js +++ b/js/mixins/form.js @@ -34,6 +34,18 @@ export default { this.validateForm() }, + handleChildFieldChange: function(event) { + // need to temporarily use this function because we will no longer be passing + // parent_uid or watch from the child components + const { value, name, valid } = event + if (typeof this.fields[name] !== undefined) { + this.fields[name] = valid + this.changed = true + } + + this.validateForm() + }, + handleFieldMount: function(event) { const { name, optional, valid } = event this.fields[name] = optional || valid