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: { watch: {
modelValue() { modelValue() {
if (this.modelValue) { this.refreshContent()
console.log(this.modelValue)
this.content = {
operator: this.operators[0].value,
...this.modelValue,
property_meta: {
id: this.property.id,
type: this.property.type
}
}
}
}, },
'content.operator': function (val) { 'content.operator': function (val) {
if (val) { if (val) {
console.log(val,'operatorChanged')
this.operatorChanged() this.operatorChanged()
} }
} }
@ -173,7 +162,21 @@ export default {
}, },
emitInput () { emitInput () {
this.$emit('update:modelValue', this.castContent(this.content)) 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> </script>