mercredi 11 janvier 2023

Precheck checkboxes in b-form-checkbox-group (Vue and Bootstrap)

I have an array (a1) that contains all objects that are relevant for this problem and a smaller array (a2) that contains some of those objects. Now, I want to create a checkbox group to edit a2 with the options being all objects of a1. Therefore, I want to precheck all checkboxes within that group that are included in a2 but I can't figure out how to. Can someone help please?

This is where I'm currently at:

<b-form-checkbox-group v-model="a2" class="overflow-auto fixed-height" style="height: 150px">
   <b-form-checkbox
      v-for="o in a1"             
      :value="o.id"
      :key="o.id"
      >
      
   </b-form-checkbox>
</b-form-checkbox-group>

a1, a2 and their objects are retrieved from a database.




Aucun commentaire:

Enregistrer un commentaire