vendredi 10 avril 2020

checkbox inputs are checked by default?

I have some checkbox inputs in my vue app that I am trying to render as unchecked but for some reason they stay checked

my data looks like so:

 data: {
                students: [
                    {
                        "id": 189,
                        "first_name": "el Mahdi",
                        "avatar": null,
                        "group_id": 24,
                        "full_name": ", el Mahdi",
                        "exclude": false,
                        "isGrouped": false, 
                        "include": false,
                    }, {
                        "id": 190,
                        "first_name": "Walid",
                        "avatar": null,
                        "group_id": 24,
                        "full_name": ", Walid",
                        "exclude": false,
                        "isGrouped": false, 
                        "include": false, 
                    }]
}

and my html looks like the following

   <li v-for="absentStudent in absentStudents" class="list-unstyled">
                        <input type="checkbox" @change="check($event)" v-model="absentStudentsSelected" :value="absentStudent.id" checked="false">
                        
                    </li>

I don't know where the checked="true" attribute is being set from at all but when I check my elements in the console, the value is set to checked and that's how it renders in the DOM




Aucun commentaire:

Enregistrer un commentaire