Skip to content

Commit cd4e9b3

Browse files
committed
Get data from server when value changes
1 parent 3490b41 commit cd4e9b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

resources/js/components/inputs/relationship/RelationshipInput.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ export default {
201201
itemData(data, olddata) {
202202
if (this.initializing) return;
203203
this.$emit('item-data-updated', data);
204+
},
205+
206+
value(value) {
207+
// If all the values already have their data stored, then don't bother fetching it again.
208+
if (value.every(id => this.data.map(item => item.id).includes(id))) return;
209+
210+
this.getDataForSelections(value);
204211
}
205212
206213
},

0 commit comments

Comments
 (0)