[Vuejs]-Vuejs v-for multidimensional array json_object

1👍

When v-for object the value is the value of each key you dont need to access any prop since the value is not an key/value but value only

  <td v-for="value in timeblock.appointment">
         {{value}}
    </td>

1👍

Your timeblock.appointment is not an array but just a plain object. Try

<td>
  {{timeblock.appointment.id}}
</td>

0👍

Your code is almost correct, but you are not giving the second loop the index to read from: this is the error.

Just make it (timeblock, index) to read your index and in the second loop use your timeblock[index].appointment

<tr v-for="(timeblock,index) in responseAPI">
  <td>
    {{timeblock.time}}
  </td>
  <td v-for="value in timeblock[index].appointment">
    {{value.id}}
  </td>
  <td>
    {{timeblock.break}}
  </td>
  <td>
    {{timeblock.scheduled}}
  </td>
  <td>
    {{timeblock.text}}
  </td>
</tr>

Leave a comment