I am trying to set a group field value when a radio button is ticked but it doesn't seem to be setting (no errors thrown either).
<formulate-form v-model="values" @submit="handleSubmission">
<formulate-input
v-if="values.calendar_size"
type="radio"
name="mailing_cartons"
key="mailing_cartons"
label="Would you like mailing cartons?"
validation="required"
@input="prepopulateDelivery()"
:options="{ 1: 'Yes', 0: 'No' }"
></formulate-input>
<formulate-input
type="group"
name="delivery"
:repeatable="true"
label="Delivery details:"
add-label="+ Add Address"
validation="required"
>
<formulate-input type="text" name="del_contact_name" label="Contact name:" validation="required"></formulate-input>
</formulate-input>
</formulate-form>
Here is the JS:
new Vue({
el: "#app",
data: {
values: {},
},
methods: {
prepopulateDelivery() {
if (this.values.mailing_cartons == 1) {
console.log(this.values.delivery[0]); // works fine, logs an object correctly
this.values.delivery[0].del_contact_name = "TEST"; // does nothing to the value
}
},
},
});
I am expecting "TEST" to appear as a value in the contact name field but nothing is set.
Using vue@2.6.12 and vue-formulate@2.4.5