pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
vue/valid-v-memo |
enforce valid `v-memo` directives |
v7.16.0 |
enforce valid
v-memo
directives
- ⚙️ This rule is included in all of
"plugin:vue/vue3-essential"
,*.configs["flat/essential"]
,"plugin:vue/vue3-strongly-recommended"
,*.configs["flat/strongly-recommended"]
,"plugin:vue/vue3-recommended"
and*.configs["flat/recommended"]
.
This rule checks whether every v-memo
directive is valid.
This rule reports v-memo
directives in the following cases:
- The directive has that argument. E.g.
<div v-memo:aaa></div>
- The directive has that modifier. E.g.
<div v-memo.bbb></div>
- The directive does not have that attribute value. E.g.
<div v-memo></div>
- The attribute value of the directive is definitely not array. E.g.
<div v-memo="{x}"></div>
- The directive was used inside v-for. E.g.
<div v-for="i in items"><div v-memo="[i]" /></div>
<template>
<!-- ✓ GOOD -->
<div v-memo="[x]" />
<!-- ✗ BAD -->
<div v-memo />
<div v-memo:aaa="[x]" />
<div v-memo.bbb="[x]" />
<div v-memo="{ x }" />
<div v-for="i in items">
<div v-memo="[i]" />
</div>
</template>
::: warning Note This rule does not check syntax errors in directives because it's checked by vue/no-parsing-error rule. :::
Nothing.
This rule was introduced in eslint-plugin-vue v7.16.0