vue路由过渡效果

    //html结构
    <transition name='fade'>
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </transition>
    //fade(过渡)
    .fade-enter-active, .fade-leave-active {
      transition: opacity .5s;
    }
    .fade-enter, .fade-leave-to  {
      opacity: 0;
    }

    //bounce(动画)
    .bounce-enter-active {
      animation: bounce-in .5s;
    }
    .bounce-leave-active {
      animation: bounce-in .5s reverse;
    }
    @keyframes bounce-in {
      0% {
        transform: scale(0);
      }
      50% {
        transform: scale(1.5);
      }
      100% {
        transform: scale(1);
      }
    }
Logo

前往低代码交流专区

更多推荐