Angular getSimpleChangesStore的实现原理

165 阅读1分钟

父组件的ngOnInit钩子里,并没有SimpleChanges相关的数据结构:

而子组件就不一样了:

直接从Component实例的__ngSimpleChanges__字段里读取数据:


更多Jerry的原创文章,尽在:“汪子熙”: