From 437ec1c811be7c157a273f32a57928be6f75bf3a Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Wed, 24 Jan 2024 17:02:57 +0100 Subject: [PATCH] Attempt to fix logic --- .../form-logic-components/ColumnCondition.vue | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/client/components/open/forms/components/form-logic-components/ColumnCondition.vue b/client/components/open/forms/components/form-logic-components/ColumnCondition.vue index fa476c6..c9dabd9 100644 --- a/client/components/open/forms/components/form-logic-components/ColumnCondition.vue +++ b/client/components/open/forms/components/form-logic-components/ColumnCondition.vue @@ -104,21 +104,10 @@ export default { watch: { modelValue() { - if (this.modelValue) { - console.log(this.modelValue) - this.content = { - operator: this.operators[0].value, - ...this.modelValue, - property_meta: { - id: this.property.id, - type: this.property.type - } - } - } + this.refreshContent() }, 'content.operator': function (val) { if (val) { - console.log(val,'operatorChanged') this.operatorChanged() } } @@ -173,7 +162,21 @@ export default { }, emitInput () { this.$emit('update:modelValue', this.castContent(this.content)) + }, + refreshContent() { + this.content = { + operator: this.operators[0].value, + ...this.modelValue, + property_meta: { + id: this.property.id, + type: this.property.type + } + } } + }, + + mounted() { + this.refreshContent() } }