I have a modal rendered on top of a semi-transparent backdrop. Both elements have a v-if controlled by the same variable.
Although the enter transition animation works fine, the `leave`` transition animation is ignored (it should fade out smoothly, instead it disappears instantly). Why?
Markup:
<div id="app">
  <button @click="showModal = !showModal">Toggle Modal</button>
  
  <div v-if="showModal" class="modalBackdrop">
    <transition name="content" appear>
      <div v-if="showModal" class="modalContent">
        Modal
      </div>
    </transition>
  </div>
</div>
CSS:
.content-enter-active {
  animation: slide-up .75s;
}
.content-leave-active {
  animation: fade-out .75s;
}
@keyframes slide-up {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
 
                        
It seems that the div with
modalBackdropclass is disappearing before the nested div with classmodalContentdoes its transition, so try to wrap modal Backdrop by a transition component with namebackdropwhich also takes thefade-outanimation :template :
DEMO