zoukankan      html  css  js  c++  java
  • vue过场动画

    <template>
      <div id="app">
        <transition :enter-active-class="enterTransition" :leave-active-class="leaveTransition">
          <keep-alive>
            <router-view class="routeView" />
          </keep-alive>
        </transition>
      </div>
    </template>
    
    <script>
    import myhea from "@/components/hea.vue";
    import myfooter from "@/components/footer.vue";
    export default {
      name: "App",
      components: {
        myhea,
        myfooter,
      },
      data() {
        return {
          enterTransition: "animate__animated animate__fadeIn",
          leaveTransition: "animate__animated animate__fadeOut",
        };
      },
      watch: {
        $route(to, from) {
          let toDepth = to.meta.depth;
          let fromDepth = from.meta.depth;
          if (fromDepth > toDepth) {
            this.enterTransition = "animate__animated animate__fadeInLeft";
            this.leaveTransition = "animate__animated animate__fadeOutRight";
          } else if (fromDepth < toDepth) {
            this.enterTransition = "animate__animated animate__fadeInRight";
            this.leaveTransition = "animate__animated animate__fadeOutLeft";
          } else {
            this.enterTransition = "animate__animated animate__fadeIn";
            this.leaveTransition = "animate__animated animate__fadeOut";
          }
        },
      },
    };
    </script>
    
    <style>
    .routeView {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
    }
    * {
      margin: 0px;
      padding: 0px;
    }
    #app {
      min- 20rem;
      font-family: Avenir, Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-align: center;
      color: #2c3e50;
    }
    </style>
    $ npm install animate.css --save
    

      

    代码改变了我们,也改变了世界
  • 相关阅读:
    List<T>Find方法,FindAll方法,Contains方法,Equals方法
    C#SerialPort如何读取串口数据并显示在TextBox上
    49、css属性相关
    40、协程
    45、mysql 储存过程
    37、进程之间的通信
    38、线程及其方法
    39、多线程和线程池
    33、验证客户端的合法性、socketserver模块
    32、黏包的解决方式、struct模块
  • 原文地址:https://www.cnblogs.com/wencaiguagua/p/13716995.html
Copyright © 2011-2022 走看看