Attempt to fix logic

This commit is contained in:
Julien Nahum 2024-01-24 17:02:57 +01:00
parent ed17b0e985
commit 437ec1c811
1 changed files with 15 additions and 12 deletions

View File

@ -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()
}
}
</script>