//先来一个简单的入场
<template>
<div id="box">
<input type="button" value="按钮" @click="toggle">
<transition name="fade">
<div id="div1" v-show="bSign"></div>
</transition>
</div>
</template>
<script>
export default{
data(){
return{
bSign:true
}
},
methods:{
toggle(){
this.bSign=!this.bSign;
}
}
}
</script>
<style>
#div1{
width:100px;
height:100px;
background: red;
}
.fade-enter-active,.fade-leave-active{
transition: all .3s ease;
opacity: 1;
transform: translateX(0px);
}
.fade-enter,.fade-leave-to{
transform: translateX(10px);
opacity: 0;
}
</style>

再来一个引用animate.css

 <template>
<div id="box">
<input type="button" value="按钮" @click="toggle">
<transition name="fade" enter-active-class="animated zoomInLeft"
        leave-active-class="animated zoomOutRight">
<div id="div1" v-show="bSign"></div>
</transition>
</div>
</template>
<script> export default{
data(){
return{
bSign:true
}
},
methods:{
toggle(){
this.bSign=!this.bSign;
}
}
}
</script>
<style>
#div1{
width:100px;
height:100px;
background: red;
margin:80px;
}
/* .fade-enter-active,.fade-leave-active{
transition: all .3s ease;
opacity: 1;
transform: translateX(0px);
}
.fade-enter,.fade-leave-to{
transform: translateX(10px);
opacity: 0;
} */
</style>

最新文章

  1. USACO翻译:USACO 2014 FEB SILVER 三题
  2. Python之with语句
  3. leetcode 127. Word Ladder ----- java
  4. sql查看数据库表使用情况
  5. stringstream字符串流
  6. Storm On YARN带来的好处
  7. asp.net MVC中的AppendTrailingSlash以及LowercaseUrls
  8. 3390: [Usaco2004 Dec]Bad Cowtractors牛的报复
  9. rowid去重(删除表的重复记录)
  10. 1,入门-Hello Soring Boot
  11. Python Pandas 库的使用例子
  12. Linq 连接运算符:Concat
  13. JavaScript中高阶函数
  14. 别开心太早,Python 官方文档的翻译差远了
  15. 盒模型的垂直居中css
  16. 酷狗.kgtemp文件加密算法逆向
  17. spring-data-mongo的MongoTemplate开发
  18. CSS3美化有序列表
  19. Netty实践一(数据通信)
  20. 随机数的生成 - rand(), srand()

热门文章

  1. python玩丢手绢问题,出局的顺序
  2. SQL Server 中BIT类型字段增删查改那点事
  3. DOM精简版笔记
  4. C#关键字as出现的错误
  5. js高级-面向对象继承
  6. js高级-闭包
  7. tomcat支持 https
  8. div 光标处插入内容
  9. 服务器安装pip
  10. RecycleView 使用自定义CardLayouManager内容无法滚动问题