[Vuejs]-Vue.js checkboxes not working with model that uses Laravel SparkForm

0๐Ÿ‘

new Vue({
    el: '#app',
    data(){
      return {
        form : {
           services : []
        },
      team : {
        services : [
         {
         "name" : "Service name #1",
         "id" : 1
         },
         {
         "name" : "Service name #2",
         "id" : 2
         }
        ]
      }
     }
    }
});
<div id="app">
  <label v-for="service in team.services">
    <input type="checkbox" v-model="form.services" :value="service.id"/>{{service.name}}
  </label>
{{form.services}}
</div>

Leave a comment