Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Angular 9 中,ViewChild 的静态值有一个默认值 (false)。我可以更改默认值吗?全局为我的应用程序
static:当你想访问 ngOnInit 中的 ViewChild 时,必须使用 true。
static:当你想访问 ngAfterViewInit 中的 ViewChild 时,必须使用 false。当您的模板上有结构指令 (*ngIf) 时。