0

I need help in making my checkboxes in an array format. I have these codes:

<form @keyup="validate">
 <div class="form-group">
  <thead>
   <th>Task Schedule</th>
   <th>Notify Me</th>
   <th>Email Me</th>
  </thead>
  <tbody>
   <tr v-for="(row, index) in tableData.data" :key="index">
    <td> {{ row.name }} </td>
    <td><input type="checkbox" id="notify" name="notify" :value="tasks.id" v-model="data.notify"></td>
    <td><input type="checkbox" id="email" name="email" :value="tasks.id"  v-model="data.email"></td>
   </tr>
  </tbody>
 </div>
</form>

Not sure though about the v-model of my checkboxes. because if I check even just one checkbox, the other boxes also gets checked. I think I need to add computed as well but Im not sure what to code. Thanks

3
  • Similar question. Commented Nov 11, 2020 at 10:01
  • Can you post the content of tableData so that it will be more clear Commented Nov 11, 2020 at 10:52
  • You want something more like v-model="notify[index]" and define your notify property as an array Commented Nov 11, 2020 at 11:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.