zoukankan      html  css  js  c++  java
  • animate和过度动画同时使用.html

    1将animate和过度动画的类名添加到transition对应的类上

    2appear  设置初始样式(页面刷新样式)appear-active-class

    3type设置动画时间依据类型(transition或animate)

    4可以通过:duration来设置动画时间,补充3

     <style>
        .fade-enter,.fade-leave-to{
          opacity: 0;
        }
        .fade-enter-active,.fade-leave-active{
          transition: opacity 1s;
        }
      </style>
    </head>
    <body>
      <!-- 
        过程如下:
         显示  fade-enter,fade-enter-active      fade-enter-active,fade-enter-to     空
         隐藏  fade-leave,fade-leave-active      fade-leave-active,fade-leave-to     空
      -->
      <div id="root">
        <transition name='fade' 
          appear
          appear-active-class='animated tada'
          enter-active-class='animated tada fade-enter-active'
          leave-active-class='animated rubberBand fade-leave-active'
        >
          <h1 v-show='show'>
            最是年少时模样
          </h1>
        </transition>
        <button @click='change'>切换</button>
      </div>
      <script>
        var vm=new Vue({
          el:'#root',
          data:{
            show:true
          },
          methods:{
            change:function(){
              this.show=!this.show;
            }
          }
        })
      </script>
    </body>
  • 相关阅读:
    1245. Tree Diameter
    771. Jewels and Stones
    830. Positions of Large Groups
    648. Replace Words
    647. Palindromic Substrings
    435. Non-overlapping Intervals
    646. Maximum Length of Pair Chain
    645. Set Mismatch
    242. Valid Anagram
    438. Find All Anagrams in a String
  • 原文地址:https://www.cnblogs.com/em2464/p/12335224.html
Copyright © 2011-2022 走看看