div在显示隐藏(v-if)的动画过度--transition

左上角右下角显示一个提醒框,十五秒后自动消失或者手动消失

将要通过v-if显示隐藏的标签外部套上一层transition标签,并给标签name属性进行命名。

    <transition name="move">
      <Schedule ></Schedule>
    </transition>

 在css中进行各种动作

 // 开始进入
.move-enter {
   margin-top: 5rem;
  opacity: 0;
}
// 进入中的过程
.move-enter-active {
  transition: all 2s;
}
// 进入完毕
.move-enter-to {
   margin-top: 0px;
  opacity: 1;
}
// 准备离开
.move-leave {
  margin-top: 0px;
  opacity: 1;
}
// 离开的过程
.move-leave-active {
  transition: all 1s;
}
// 离开完毕
.move-leave-to {
   margin-top: 5rem;
  opacity: 0;
}

右上角或者右下角各种定位

 position: fixed;

  top: 10%;

  right: 52px;

  background-color: #ffffff;

猜你喜欢

转载自blog.csdn.net/a99101/article/details/132280055