上面代码是简化后的,可以发现 `isUpdatingChildComponent` 初始值为 `false`,只有当 `updateChildComponent` 函数开始执行的时候会被更新为 `true`,当 `updateChildComponent` 执行结束时又将 `isUpdatingChildComponent` 的值还原为 `false`,这是因为 `updateChildComponent` 函数需要更新实例对象的 `$attrs` 和 `$listeners` 属性,所以此时是不需要提示 `$attrs` 和 `$listeners` 是只读属性的。
|