One interesting feature in my app is the sidebar:
https://i.sstatic.net/7Z9IN.png
The code for the tree item component looks like this :
<!-- tree item template -->
<script type="text/x-template" id="tree-item-template">
<div>
<div>
<user-card @toggle-supervisor="toggle" :user_info="item" :key="item.id_user"></user-card>
</div>
<div v-show="isOpen" v-if="isFolder" class="ml-3">
<tree-item
v-for="(child, index) in item.employees"
:key="index"
:item="child"
></tree-item>
</div>
</div>
</script>
This component has a nested component named user-card.
I am aiming to create an array containing all components with the name 'user-card', irrespective of nesting within other components.
This is required so that I can change the color of the name to blue when selected (clicked) and back to black when deselected.
I have discovered that using this.$children
allows me to fetch a list of components within a component, but not all of them. Therefore, I am exploring if there is a way to retrieve a list of all elements based on their component name.