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

首頁 > 語言 > JavaScript > 正文

vue實(shí)現(xiàn)循環(huán)切換動(dòng)畫

2024-05-06 15:28:41
字體:
供稿:網(wǎng)友

本文實(shí)例為大家分享了vue實(shí)現(xiàn)循環(huán)切換動(dòng)畫的具體代碼,供大家參考,具體內(nèi)容如下

注意動(dòng)畫的鉤子函數(shù)的判斷邏輯,注意動(dòng)畫編寫時(shí)類名的順序!!

<!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>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持錯(cuò)新站長站。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 那坡县| 清新县| 娱乐| 黔江区| 永济市| 香港 | 库伦旗| 江西省| 平安县| 遂平县| 五莲县| 石狮市| 台南市| 博罗县| 陆河县| 上林县| 巩义市| 纳雍县| 上杭县| 瑞丽市| 耿马| 宁南县| 孟村| 四会市| 宜兰县| 古田县| 额尔古纳市| 赤城县| 洛扎县| 昆山市| 东乌珠穆沁旗| 资源县| 宜宾市| 嘉禾县| 宣威市| 扎鲁特旗| 温宿县| 广丰县| 福建省| 旬阳县| 内江市|