[Vuejs]-I can't show the text using v-for

0πŸ‘

<table>
  <template v-for="(field) in mappedFields">
    <tr v-for="(val, j) in body[field]" :key="j">
      <td>{{ val }} -</td>
    </tr>
  </template>
</table>

Maybe it help you .

0πŸ‘

β€˜body’ here is not an array. You don’t need to use v-for.
you can directly write

{{body.name}}

It will give you this: ["amine", "bill"]
Further if you want these values you can go for;

{{body.name[0]}} and
{{body.name[1]}}

Leave a comment