使用remove函数,它不会触发组件的生命周期,还得手动调用ngOnDestroy ```typescript constructor(private element: ElementRef) {} // 你要销毁的时候调用它 triggerDestroy(){ this.element.nativeElement.remove(); this.ngOnDestroy() } ```