Skip to content

vue/no-useless-v-bind

禁止不必要的 v-bind 指令

  • 🔧 command line 上的 --fix 选项可以自动修复此规则报告的一些问题。

📖 规则详情

此规则报告具有字符串字面量值的 v-bind。具有字符串字面量值的 v-bind 可以更改为静态属性定义。

¥This rule reports v-bind with a string literal value.\ The v-bind with a string literal value can be changed to a static attribute definition.

Now loading...

🔧选项

¥🔧 Options

js
{
  "vue/no-useless-v-bind": ["error", {
    "ignoreIncludesComment": false,
    "ignoreStringEscape": false
  }]
}
  • ignoreIncludesComment ...如果是 true,则不要报告包含注释的表达式。默认 false

    ¥ignoreIncludesComment ... If true, do not report expressions containing comments. default false.

  • ignoreStringEscape ...如果是 true,则不要报告带有有用转义的字符串字面量。默认 false

    ¥ignoreStringEscape ... If true, do not report string literals with useful escapes. default false.

"ignoreIncludesComment": true

Now loading...

"ignoreStringEscape": true

Now loading...

👫相关规则

¥👫 Related Rules

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v7.0.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.0.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.0 中文网 - 粤ICP备13048890号