vue组件弹框过渡效果,如,点击显示为从左到右滑动,收回隐藏为从右到左滑动

Posted lsc-boke

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue组件弹框过渡效果,如,点击显示为从左到右滑动,收回隐藏为从右到左滑动相关的知识,希望对你有一定的参考价值。

vue组件

<transition name="carHistory">
      <car-History-Line v-show="showHistoryLine" @closeHitsory=‘closeHitsory‘></car-History-Line>
    </transition>

css

.carHistory-enter {
  animation: carHistory-dialog-fade-in 0.3s ease;
}
.carHistory-leave {
  animation: carHistory-dialog-fade-out 0.3s ease forwards;
}
.carHistory-enter-active {
  animation: carHistory-dialog-fade-in 0.3s ease;
}
.carHistory-leave-active {
  animation: carHistory-dialog-fade-out 0.3s ease forwards;
}

@keyframes carHistory-dialog-fade-in {
  0% {
    transform: translate3d(-100%, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes carHistory-dialog-fade-out {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(-100%, 0, 0);
    opacity: 1;
  }
}

这个是从左往右滑动

.fullscreen-enter {
  animation: fullscreen-dialog-fade-in 0.3s ease;
}
.fullscreen-leave {
  animation: fullscreen-dialog-fade-out 0.3s ease forwards;
}
.fullscreen-enter-active {
  animation: fullscreen-dialog-fade-in 0.3s ease;
}
.fullscreen-leave-active {
  animation: fullscreen-dialog-fade-out 0.3s ease forwards;
}

@keyframes fullscreen-dialog-fade-in {
  0% {
    transform: translate3d(0, -100%, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes fullscreen-dialog-fade-out {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, -100%, 0);
    opacity: 1;
  }
}

这个为从上往下滑动

以上是关于vue组件弹框过渡效果,如,点击显示为从左到右滑动,收回隐藏为从右到左滑动的主要内容,如果未能解决你的问题,请参考以下文章

Android 从左到右滑动动画

需要从左到右再从右到左改变segue过渡

qt qml:水平淡化图像(即从左到右......不是整个图像)

jquery滑动侧边栏从左到右

jquery切换从左到右和向后滑动

过渡画面从左到右?