JSのアニメーションのVUE - アニメーションフック

https://www.jianshu.com/p/55305c53de13

トランジションアニメーションフック知人:

  < DIV ID = "ルート" > 
    < 遷移= 'フェード'
       @の前に入力します= 'handleBeforeEnter'
       @enter = 'handleEnter'を
       入力した後、@ = 'handleAfterEnter'
     > 
      < h1のV-ショー= 'ショー' >
        ときの外観のほとんどは若いです
      </ H1 > 
    </ 遷移> 
    < ボタン@click = '変更' >切换</ ボタン> 
  </ DIV > 
  < スクリプト> 
    VAR VM = 新しいヴュー({
      上:' #root ' 
      データ:{
        ショー:
      }、
      方法:{
        変更:関数(){
           この.SHOW =!この.SHOW;
        }、
        handleBeforeEnter:関数(EL){
          console.log(' ' );
          el.style.color = ' '
        }、
        handleEnter:関数(EL、行わ){
          console.log(' 入力' );
          setTimeout(()=> {
            el.style.color = ' 緑色' 
          }、2000 
          setTimeout(()=> {
            行って();
          }、4000 
        }、
        handleAfterEnter:関数(EL){
          console.log(' ' );
          el.style.color = ' #000000 '
        }
      }
    })
  </ スクリプト>

 

おすすめ

転載: www.cnblogs.com/em2464/p/12337910.html