somascope
9/3/2018 - 10:49 PM

Vue transition fade

<template>

  <transition name="fade">
    <my-component v-if="someProperty"></my-component>
  </transition>

</template>

<script>
// set someProperty to true/false
</script>

<style scoped>
  .fade-enter-active, .fade-leave-active {
    transition: opacity .2s
  }
  .fade-enter, .fade-leave-active {
    opacity: 0
  }
</style>