如下图所示:标识为1和2的unit,
其后台数据的expanded属性值,分别为true和false:
这个属性的赋值逻辑在unit-list.service.ts的第72行:unitTreeService.isExpanded方法,输入参数分别是unit节点的id和在树里的层级结构:
对于Rustic unit来说,this.treeToggle$.value这个Map里,没有对应的数据。
The returned (boolean) expand state is driven by the global toggle
state (expand / collapse all) and the toggle state for individual units.
There’s also the minimalExpanded taken into consideration.
如果全局状态是collapsed并且单个toggle状态不是expand,则最后计算出来的expanded状态为false.
this.minimalExpanded为1,意思是至少展开level为0的所有节点: