Answers for "transition vue"

0

vue transition v-if else

<div id="demo">
    <button v-on:click="show = !show">
        Toggle
    </button>
    <transition name="fade">
        <p key=1 v-if="show">hello</p>
        <p key=2 v-else>Goodbye</p>
    </transition>
</div>
Posted by: Guest on October-14-2020
3

vue transition

<transition name="wrapper">
	<span v-if="show"></span>
</transition>
<script>
export default {
  data () {
    return {
      show: true
    }
  }
</script>
<style scoped>
  .wrapper-enter-active {
    animation: finished 2.5s reverse;
  }
  .wrapper-leave-active {
    animation: finished 2.5s;
  }
  @keyframes finished {
    0% { opacity: 1; top: 0;}
    50% { opacity: 1; top: 0;}
    60% { opacity: 1; }
    100% { opacity: 0; top: -100vh;}
  }
</style>
Posted by: Guest on January-13-2021
2

transition vue

.fade-enter-active, .fade-leave-active {
  transition: opacity 3s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
Posted by: Guest on June-15-2021
2

vue transition enter before

<transition
  v-on:before-enter="beforeEnter"
  v-on:enter="enter"
  v-on:after-enter="afterEnter"
  v-on:enter-cancelled="enterCancelled"

  v-on:before-leave="beforeLeave"
  v-on:leave="leave"
  v-on:after-leave="afterLeave"
  v-on:leave-cancelled="leaveCancelled"
>
  <!-- ... -->
</transition>
Posted by: Guest on June-13-2021
0

vuejs transition to switch between pages

<!-- App.vue -->
<router-view v-slot="{ Component }">
  	<transition name="slither" mode="in-out">
    	<component :is="Component"></component>
	</transition>
</router-view>
Posted by: Guest on December-21-2020

Browse Popular Code Answers by Language