我无法解决这个问题。我已经把它归结为我只是单击一个按钮,它不会更改子行中的任何数据,并且仍然会发生重建。
我制作方法来捕获八个生命周期事件中的每一个。当我按下按钮时,父组件(包含所有父行)会点击这些钩子:
ngDoCheck
ngAfterContentChecked
each parent row is revisited in here
ngAfterViewChecked
所以我想这意味着活动在视图检查期间完成。
我使用ngForTrackBy来找出重建每个父行的时间。
唯一奇怪的事情是两个:
1. The parent rows are not components. (They were written before I came to the project.)
2. We are using Semantic UI. I don't know what Semantic UI is doing behind the scenes.
结构是这样的:
table-component
parent row (not an angular component)
child-row-component
parent row (not an angular component)
child-row-component
parent row (not an angular component)
child-row-component
. . .
子行中能够触发表组件完全重建的按钮只是<button>Nothing particular</button>
。
我无法做出简单的测试用例。我做了一个plu ,,但行为消失了。
对Semantic UI或Angular有深入了解的人是否知道为什么会这样?
我能够完全删除使用Semantic UI运行的代码。相同的行为。所以语义UI与它无关。