从实例化组件,渲染组件模板时,各声明周期就已开始 ngOnChanges 输入属性发生变化是触发,但组件内部改变输入属性是不会触发的 import { Component, Input, OnInit, OnChanges } from '@angular/core'; @Component({ selector