更新时间:2022-11-30 11:57:33
尝试*ngIf="!overwrite && !!saveName"
将saveName
转换为布尔值
TypeScript给出该错误的原因大致是:您在应该使用布尔值的地方使用了字符串.
The reason TypeScript gives for the error is roughly: you are using a string where you should be using a boolean.
我认为它仅在这种情况下发生的原因是,如果您拥有true || anything
,则仅会评估第一个(因为如果第一个为true,则整个表达式将为true,而与其余情况无关)
The reason I think that it only happens in that circumstance is because if you have true || anything
only the first will be evaluated (because if the first is true the whole expression will true regardless of the rest)
'(snap: DataSnapshot) => 类型的参数void' 不能分配给 '(a: DataSnapshot) => 类型的参数.布尔值
类型'string |的参数不能将'null'分配给'ValueFn< SVGPathElement,Datum [],string |编号|布尔| null>'
Typescript编译器永远不会错误:键入'string |数字"不能分配给“从不"类型.不能将类型“字符串"分配给类型“从不"
“类型为"void(exeCallback :: *)(int)"的值"不能将其分配给类型为"void(*)(int)"的实体,
不能将类型'Query'分配给类型'[(options ?: QueryLazyOptions< Exact< {其中?: