Appearance
vue/no-boolean-default
禁止布尔默认值
¥disallow boolean defaults
该规则可防止布尔属性具有默认值。
¥The rule prevents Boolean props from having a default value.
📖 规则详情
该规则是为了强制执行始终将布尔属性默认为 false 的 HTML 标准。
¥The rule is to enforce the HTML standard of always defaulting boolean attributes to false.
🔧选项
¥🔧 Options
'no-default'
(默认)允许 prop 定义对象,但强制default
属性未定义。¥
'no-default'
(default) allows a prop definition object, but enforces that thedefault
property not be defined.'default-false'
强制可以设置默认值,但必须设置为false
。¥
'default-false'
enforces that the default can be set but must be set tofalse
.
json
"vue/no-boolean-default": ["error", "no-default|default-false"]
👫相关规则
¥👫 Related Rules
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation