useVueValidVElse
¥Summary
-
规则生效日期:
v2.3.6¥Rule available since:
v2.3.6 -
诊断类别:
lint/nursery/useVueValidVElse¥Diagnostic Category:
lint/nursery/useVueValidVElse -
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 information。
¥The default severity of this rule is information.
-
此规则属于以下域:
¥This rule belongs to the following domains:
-
来源:
¥Sources:
-
与
vue/valid-v-else相同¥Same as
vue/valid-v-else
-
¥How to configure
{ "linter": { "rules": { "nursery": { "useVueValidVElse": "error" } } }}¥Description
强制使用 v-else 语句。
¥Enforce valid usage of v-else.
此规则会在以下情况下报告 v-else 指令:
¥This rule reports v-else directives in the following cases:
-
该指令包含一个参数。例如
<div v-if="foo"></div><div v-else:aaa></div>¥The directive has an argument. E.g.
<div v-if="foo"></div><div v-else:aaa></div> -
该指令有一个修饰符。例如
<div v-if="foo"></div><div v-else.bbb></div>¥The directive has a modifier. E.g.
<div v-if="foo"></div><div v-else.bbb></div> -
该指令包含一个属性值。例如
<div v-if="foo"></div><div v-else="bar"></div>¥The directive has an attribute value. E.g.
<div v-if="foo"></div><div v-else="bar"></div> -
该指令位于前一个元素没有
v-if/v-else-if指令的元素上。例如<div v-else></div>¥The directive is on elements where the previous element doesn’t have
v-if/v-else-ifdirectives. E.g.<div v-else></div> -
该指令位于包含
v-if/v-else-if指令的元素上。例如<div v-if="foo" v-else></div>¥The directive is on elements which have
v-if/v-else-ifdirectives. E.g.<div v-if="foo" v-else></div>
¥Examples
¥Invalid
<div v-else:arg></div><div v-else.mod></div><div v-else="value"></div><div v-else></div><div v-if="foo" v-else></div>¥Valid
<div v-if="foo"></div><div v-else></div><div v-if="foo"></div><div v-else-if="bar"></div><div v-else></div>¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号