mardi 22 mars 2022

Filtering items, checkbox issue laravel + vue js

I have a "Messages" table in the database. I am trying to make a filter by read/unread

For the filter, I am trying to make two checkboxes, and a "isread" variable, however I cant manage to make it work, heres what I have:

<input
                type="checkbox"
                id="1"
                class="read"
                v-model="isread"
                :value="1"
              />
<input
                type="checkbox"
                id="0"
                class="unread"
                v-model="isread"
                :value="0"
              />

The issue is that I get tons of errors in the console, plus the checkboxes get ticked/unticked at the same time (like its the same checkbox). My expected result, is that the variable "isread" stores value "0" if the "0" checkbox is checked, and "1" if the "1" is checked. Or, if both - both values get stored. Could you help me?




Aucun commentaire:

Enregistrer un commentaire