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.
VUE0046vite-doctor/vuetemplatewarnNo fix

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 changing. A plain element that stays mounted never triggers enter or leave, so the enter/leave classes and CSS never apply. Without appear, the first render does not animate either.

Add v-if or v-show to the child, bind a that changes, add appear to animate on first render, or remove the <Transition>. For lists, use <TransitionGroup> with a stable, unique per item.

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>
Copyright © 2026