跳转到内容

useVueValidVIf

此内容尚不支持你的语言。

biome.json
{
"linter": {
"rules": {
"nursery": {
"useVueValidVIf": "error"
}
}
}
}

Enforces valid v-if usage for Vue templates.

This rule reports v-if directives in following cases:

  • The directive has an argument. E.g. <div v-if:aaa="foo"></div>
  • The directive has a modifier. E.g. <div v-if.bbb="foo"></div>
  • The directive does not have an attribute value. E.g. <div v-if></div>
  • The same element also has v-else or v-else-if. E.g. <div v-if="foo" v-else></div>
<div v-if:aaa="foo"></div>
<div v-if.bbb="foo"></div>
<div v-if></div>
<div v-if="foo" v-else></div>
<div v-if="foo" v-else-if="bar"></div>
<div v-if="ok"></div>
<div v-if="a < b"></div>
<div v-if="a"></div>
<div v-else-if="b"></div>
<div v-else></div>