[ *ngIf ] 的属性名称必须为小写 [英] The attribute name of [ *ngIf ] must be in lowercase

查看:18
本文介绍了[ *ngIf ] 的属性名称必须为小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能告诉我如何在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆