Appearance
vue/v-on-function-call
强制或禁止在
v-on指令中不带参数的方法调用后使用括号
- ⛔ 此规则已在 eslint-plugin-vue v10.0.0 中删除,并由 vue/v-on-handler-style 规则替换。
📖 规则详情
此规则旨在强制将方法绑定到 v-on 或在没有参数时调用 v-on 上的方法。
¥This rule aims to enforce to bind methods to v-on or call methods on v-on when without arguments.
🔧选项
¥🔧 Options
默认值设置为 never。
¥Default is set to never.
json
{
"vue/v-on-function-call": ["error",
"always"|"never",
{
"ignoreIncludesComment": false
}
]
}"always"...在v-on指令中始终使用括号。¥
"always"... Always use parentheses inv-ondirectives."never"...切勿在v-on指令中使用括号来调用不带参数的方法。这是默认的。¥
"never"... Never use parentheses inv-ondirectives for method calls without arguments. this is default.ignoreIncludesComment...如果是true,则不要报告包含注释的表达式。默认false。¥
ignoreIncludesComment... Iftrue, do not report expressions containing comments. defaultfalse.
"always" - 在 v-on 指令中始终使用括号
¥"always" - Always use parentheses in v-on directives
"never" - 对于不带参数的方法调用,切勿在 v-on 指令中使用括号
¥"never" - Never use parentheses in v-on directives for method calls without arguments
"never", { "ignoreIncludesComment": true }
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v5.2.0 中引入
¥This rule was introduced in eslint-plugin-vue v5.2.0
🔍代码实现
¥🔍 Implementation