From a6de3d3874546972f2c1d316c745374e40e37041 Mon Sep 17 00:00:00 2001 From: jmverges Date: Thu, 6 Apr 2023 08:44:23 +0100 Subject: [PATCH] Allow deleting all models in a relation --- resources/js/components/FormField.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/js/components/FormField.vue b/resources/js/components/FormField.vue index 57c7a1a..cfea02a 100644 --- a/resources/js/components/FormField.vue +++ b/resources/js/components/FormField.vue @@ -53,7 +53,7 @@ import RelationshipFormItem from './RelationshipFormItem.vue' export default { - + components:{ draggable, RelationshipFormItem @@ -89,7 +89,7 @@ export default { computed: { valueAsArray: function (){ return Array.isArray(this.items) ? this.items : []; - }, + }, }, methods: { @@ -131,7 +131,7 @@ export default { }, fillValueFromChildren: function(formData) { - if(!_.isEmpty(this.$refs)){ + if(!_.isEmpty(Object.entries(this.$refs).reduce((a,[k,v]) => (v ? (a[k]=v, a) : a), {}))){ _(this.$refs).each(item => { if(item && item.fields){ item.fill(formData, this.field.attribute);