你能告诉我如何在 VS code
上删除以下消息吗?编辑?
The attribute name of [ *ngIf ] must be in lowercase.
上面的消息显示在下面的代码中
<div *ngIf="isBornOn">
</div>
最佳答案
我认为这与有关vscode-htmlhint 插件,尝试禁用它。
如果删除了警告,您可以通过设置 attr-lowercase
来禁用该规则。为假。
阅读有关此插件配置的更多信息 here
在 VSCode 中,您可以设置以下设置来禁用它。:
"htmlhint.options": {
"attr-lowercase": false
}
如果不想在使用不遵循小写规则的属性时丢失警告。相反,您可以定义一个 attribute white list :
"htmlhint.options": {
"attr-lowercase": [
"*ngIf",
"ngIf",
"*ngFor",
"ngFor",
"ngSwitch",
"ngModel"
],
"doctype-first": false
},
也可以加
doctype-first
以避免在每个组件上出现该消息。
关于visual-studio-code - [ *ngIf ] 的属性名称必须为小写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43684599/