Vue · VUE0046
Toggle the child of <Transition>
Reports a <Transition> whose native child never toggles or repeats with v-for instead of using <TransitionGroup>, unless the transition may inherit root attributes.
vue/template/require-toggle-inside-transitionsrc/rule-packs/vue/rules/vue/require-toggle-inside-transition.ts Upstream docs Run this rule
pnpm vite-doctor . --framework vue --rules vue/template/require-toggle-inside-transition
Why it matters
<Transition> animates only when its child enters or leaves: a v-if/v-else branch switching, v-show changing, or a
Recommended fix
Add v-if or v-show to the child, bind a <Transition>. For lists, use <TransitionGroup> with a stable, unique
Useful links
Example
Toggle the transitioned element
Before
<template>
<main>
<Transition name="fade">
<div class="toast">{{ message }}</div>
</Transition>
</main>
</template>
After
<template>
<main>
<Transition name="fade">
<div v-if="message" class="toast">{{ message }}</div>
</Transition>
</main>
</template>