报错
Property 'duni' has no initializer and is not definitely assigned in the constructor.ts(2564)
在
下一行@ViewChild('bhondu') duni: ElementRef<HTMLTableDataCellElement>;
使它可选使用?
打破代码在其他地方,我使用this.duni.nativeElement
给Object is possibly 'undefined'.ts(2532)
。我如何解决这个错误不改变配置文件中的任何属性
使用非空断言操作符
@ViewChild('bhondu') duni!: ElementRef<HTMLTableDataCellElement>;