[ *ngIf ] 的属性名称必须为小写 [英] The attribute name of [ *ngIf ] must be in lowercase
问题描述
你能告诉我如何在 VS code
编辑器中删除下面的消息吗?
[ *ngIf ] 的属性名必须小写.
上面的消息显示在下面的代码中
我认为这与 vscode-htmlhint 插件有关,尝试禁用它.
如果删除了警告,您可以通过将 attr-lowercase
设置为 false 来禁用该规则.
在此处
阅读有关此插件配置的更多信息在 VSCode 中,您可以设置以下设置以禁用它.
"htmlhint.options": {attr-小写":假}
如果不想在使用不遵循小写规则的属性时丢失警告.相反,您可以定义一个属性白名单:
"htmlhint.options": {attr-小写":["*ngIf","ngIf","*ngFor","ngFor","ngSwitch",ngModel"],文档类型优先":假},
也可以添加 doctype-first
以避免在每个组件上出现该消息.
Can you please tell me how to remove below message on VS code
editor?
The attribute name of [ *ngIf ] must be in lowercase.
Above message shows on below code
<div *ngIf="isBornOn">
</div>
I think it has to do with the vscode-htmlhint plugin, try disable it.
If that removed the warning you can disable just that rule by setting attr-lowercase
to false.
Read more about the configuration of this plugin here
In VSCode you can set the following settings to disable it.:
"htmlhint.options": {
"attr-lowercase": false
}
If don't want lose warning when use attributes that don't follow lower case rule. Instead of, you can define an attribute white list:
"htmlhint.options": {
"attr-lowercase": [
"*ngIf",
"ngIf",
"*ngFor",
"ngFor",
"ngSwitch",
"ngModel"
],
"doctype-first": false
},
Also can add doctype-first
to avoid that message on every component.
这篇关于[ *ngIf ] 的属性名称必须为小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!