[Vuejs]-Why I cannot see data in hierarchy table?

0👍

The problem was you cannot use v-if and v-for on the same node like I did so this is how I fix it

<template v-if="item.childrenVisible">
              <tr v-for="child in item.children" :key="child.id">
                <td>{{ child.name }}</td>
                <td>{{ child.parent }}</td>
                <td>
                  <button @click="toggleChildren(child)">Toggle Children</button>

                </td>
              </tr>
            </template>

I split up the v-for and v-if to two different node template and tr

Leave a comment