3
0

Refetch reference record when related field value changes

This commit is contained in:
Jože Fortun 2024-10-25 15:57:45 +02:00
parent cb2328ec74
commit 0bf54d0ce4

View File

@ -213,6 +213,20 @@ export default {
}
},
},
'record.values': {
deep: true,
handler (newValues = {}) {
if (this.options.referenceField) {
const { recordID: oldValue } = this.referenceRecord || {}
const newValue = newValues[this.options.referenceField]
if (oldValue !== newValue) {
this.loadRecord(this.referenceModule)
}
}
},
},
},
beforeDestroy () {