ali 1 ano atrás
pai
commit
00a1595d32

+ 8 - 4
src/components/FormBuilderCustumComponents/ProductSelector.vue

@@ -136,6 +136,7 @@ export default {
             this.inputData = newValue
           }
         }
+        this.updateFormValue()
       },
       immediate: true
     }
@@ -154,12 +155,15 @@ export default {
         }
       })
       this.selected = selected
+      this.updateFormValue()
+    },
+    updateFormValue () {
       if (this.selectionMode === 'multiple') {
-        this.inputData = selected.map(product => product.id)
-        this.$emit('update:value', selected.map(product => product.id))
+        this.inputData = this.selected.map(product => product.id)
+        this.$emit('update:value', this.selected.map(product => product.id))
       } else {
-        this.inputData = selected.id
-        this.$emit('update:value', selected.id)
+        this.inputData = this.selected.id
+        this.$emit('update:value', this.selected.id)
       }
     }
   }