I tried to bind an object as a value to a checkbox but I see a problem, you can't uncheck it.
<vs-col v-for="(region, index) in regions" :key="index">
<vs-checkbox v-model="form.regions" :vs-value="region" >{{ region.name }}</vs-checkbox>
</vs-col>
Could you pass me the structure of the object? to try to redo the problem thank you very much for the contribution
@luisDanielRoviraContreras Here is a little sample of the object structure I am working with.
data: () => ({
regions: [
{ id: 1, name: 'Queensland' },
{ id: 2, name: 'South Australia' },
{ id: 3, name: 'New South Wales' },
]
})
then should not it be only regions directly without form? something like that
<vs-col v-for="(region, index) in regions" :key="index">
<vs-checkbox v-model="regions" :vs-value="region" >{{ region.name }}</vs-checkbox>
</vs-col>
@luisDanielRoviraContreras Well, I have a form object which holds the regions model like this.
data: () => ({
form: {
regions: []
},
regions: [
{ id: 1, name: 'Queensland' },
{ id: 2, name: 'South Australia' },
{ id: 3, name: 'New South Wales' },
]
})
@VerzatileTom Ready friend and the problem is solved thank you very much please check if it works as it should
There is support in the version v3.0.19
https://lusaxweb.github.io/vuesax/components/checkbox.html#array-object-values
Thank you very much for using Vuesax and contributing to the 馃憤