1
1
之所以会发生这种情况,是因为
strict null checks
显然没有启用。当该设置未打开时,typescript基本上会忽略
您可以通过将此行添加到
如果出于某种原因,您只想要strictNullChecks,而不想要其他严格模式,以下也是可能的,尽管我建议使用完全严格模式:
|
2
0
您可以通过使用TypeScript可选的链接运算符(?)来解决此问题。
|
3
0
我通常在道具的情况下所做的是在儿童身上获得可选道具,这对我很有帮助。
在子项中,它被分配为
|
BADRUM · 执行两个获取功能后,如何导航回页面? 1 年前 |
Anaya Ammar · 渲染后未显示的值 1 年前 |
Zemelon · -moz背面可见性不适用于顺风css 1 年前 |
Mark C. · 制作一个可松开的单选按钮[关闭] 1 年前 |