I am trying to build an OKR type of component with nested tree structure. I have used dynamic recursive component to not make the depth hard code. All the nodes of the tree can be expanded. However I am not able to write a proper logic to make the nodes having alternate background. Since the nodes can be expanded, the background of the child nodes has to be adjusted accordingly.
Here is my sample in code sandbox: code link here.
What I want to achieve is like this:
when expanded it should adjust the child node backgrounds like this: