我的项目使用角 (v9)和清晰度设计系统 (v3)。
使用常春藤和严格的模板类型检查,如何处理clrForm元素的clrLayout?
<form clrForm clrLayout="horizontal" clrLabelSize="4">
[...]
</form>此表单提供下列错误消息:
Type 'string' is not assignable to type 'number'.表示属性clrLabelSize="4"。Type '"horizontal"' is not assignable to type 'Layouts'. for clrLayout="horizontal".谢谢!
发布于 2020-02-28 15:47:23
我不是一个清晰的用户,但是检查使用Layout枚举所需的源代码。字符串不能用作枚举成员。要传递标签大小的数字,只需包装[clrLabelSize]属性,使表达式计算为number。否则,它将作为字符串传递。
import { Layouts } from '[pathToClarity]/layout.service';
export class YourComponent {
Layouts = Layouts
}
<form clrForm [clrLayout]="Layouts.HORIZONTAL" [clrLabelSize]="4">我的来源是这些源文件:layout.service.ts,layout.ts
https://stackoverflow.com/questions/60454688
复制相似问题