国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

vue實現循環切換動畫

2019-11-19 12:41:17
字體:
來源:轉載
供稿:網友

本文實例為大家分享了vue實現循環切換動畫的具體代碼,供大家參考,具體內容如下

注意動畫的鉤子函數的判斷邏輯,注意動畫編寫時類名的順序!!

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>vue</title> <style>  .box{  width: 200px;  height: 200px;  background-color: red; } .guo-enter-active,.guo-leave-active{  width: 200px;  height: 200px;  opacity: 1;  background-color: red;  transition: 0.7s; } .guo-leave-to{  width: 100px;  height: 100px;  opacity: 0;  background-color: orange; } .guo-enter{  width: 100px;  height: 100px;  opacity: 0;  background-color: orange; } .box2{  margin-top: 100px; } </style> <script src='vue.min.js'></script></head><body> <div id='app'> <div>  <input type="button" value='change' @click='change'>  <transition name='guo' @after-enter='Enter' @after-leave='Leave'>  <div v-show='show' class='box'></div>  </transition>  <transition name='guo' @enter='Enter2' @after-leave='Leave2'>  <div v-show='show2' class='box box2'></div>  </transition> </div> </div> <script> new Vue({  el:'#app',  data:{  show:false,  show2:false  },  methods:{  change(){   this.show = !this.show;  },  Enter(){   this.show2 = true;  },  Leave(){   this.show2=false;  },  Leave2(){   this.show = true;  },  Enter2(){   this.show = false;  }  } }); </script></body></html>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 临沧市| 昌都县| 肇庆市| 五台县| 德令哈市| 花莲县| 屏东县| 万载县| 黔西县| 贵德县| 泽普县| 读书| 葵青区| 大荔县| 荃湾区| 湘阴县| 莱西市| 广灵县| 南郑县| 河津市| 梨树县| 白河县| 邵阳市| 崇信县| 青州市| 阳高县| 富顺县| 繁昌县| 三明市| 东阿县| 外汇| 定陶县| 元朗区| 讷河市| 湛江市| 峨眉山市| 紫阳县| 监利县| 平塘县| 綦江县| 玉龙|