Vue · Template
vite-doctor/vuetemplatewarnNo fix
Why it happens
<Transition> animates only when its child enters or leaves: a v-if/v-else branch switching, v-show changing, or a
Fix
Add v-if or v-show to the child, bind a <Transition>. For lists, use <TransitionGroup> with a stable, unique
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>
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --framework vue --rules vue/template/require-toggle-inside-transition