components: any = [
{
id: "17:12610",
name: "custom-component",
hasWarning: true,
selectableKey: 'id',
preview: 'thumbnailLink',
children: {
"17:12610": {
"name": "cc-1",
"type": "instance",
"children": {
"7:43": {
"name": "icon-slot",
"children": {},
"type": "div"
}
}
}
}
}
];
Object.keys(this.components[0].children).forEach((res) => {
console.log(res);
});
I am iterating like this but its only giving me the first ID. I want to get each children ID & Name. Also I want to track the index so that I can make changes on particular index
I want the output like this:
- id: 17:12610 name: cc-1
- id: 7:43 name: icon-slot