vue2.0——运动
来源:互联网 发布:php分页代码兄弟连 编辑:程序博客网 时间:2024/06/07 06:31
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .show_box{ width:100px; height:100px; background: aqua; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:false } }); } </script></head><body><div id="box"> <input type="button" value="点击显示隐藏" @click="show=!show"> <p class="show_box" v-show="show"></p></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .show_box{ width:300px; height:300px; background: aqua; } .fade-enter-active,.fade-leave-active{ transition: 1s all ease; } .fade-enter-active{ opacity: 1; width:300px; height:300px; } .fade-leave-active{ opacity: 0; width:100px; height:100px; } .fade-enter,.fade-leave{ opacity: 0; width:100px; height:100px; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:false } }); } </script></head><body><div id="box"> <input type="button" value="点击显示隐藏" @click="show=!show"> <transition name="fade"> <p class="show_box" v-show="show"></p> </transition></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .show_box{ width:300px; height:300px; background: aqua; } .fade-enter-active,.fade-leave-active{ transition: 1s all ease; } .fade-enter-active{ opacity: 1; width:300px; height:300px; } .fade-leave-active{ opacity: 0; width:100px; height:100px; } .fade-enter,.fade-leave{ opacity: 0; width:100px; height:100px; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:false }, methods:{ before_enter(){ console.log('动画进入之前'); }, enter(){ console.log('动画进入开始'); }, after_enter(){ console.log('动画进入完成'); }, before_leave(){ console.log('动画离开之前'); }, leave(){ console.log('动画离开开始'); }, after_leave(){ console.log('动画离开结束'); } } }); } </script></head><body><div id="box"> <input type="button" value="点击显示隐藏" @click="show=!show"> <transition name="fade" @before-enter="before_enter" @enter="enter" @after-enter="after_enter" @before-leave="before_leave" @leave="leave" @after-leave="after_leave" > <p class="show_box" v-show="show"></p> </transition></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="../css/animate.css"> <style> .show_box{ width:300px; height:300px; background: aqua; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:false } }); } </script></head><body><div id="box"> <input type="button" value="点击显示隐藏" @click="show=!show"> <transition enter-active-class="zoomInLeft" leave-active-class="zoomOutRight" > <p class="show_box animated" v-show="show"></p> </transition></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="../css/animate.css"> <style> .show_box{ width:300px; height:300px; background: aqua; margin:10px auto; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:false } }); } </script></head><body><div id="box"> <input type="button" value="点击显示隐藏" @click="show=!show"> <transition-group enter-active-class="zoomInLeft" leave-active-class="zoomOutRight" > <p class="show_box animated" v-show="show" :key="1"></p> <p class="show_box animated" v-show="show" :key="2"></p> </transition-group></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="../css/animate.css"> <style> .show_box{ width:100px; height:100px; line-height: 100px; text-align: center; background: aqua; margin:10px auto; } </style> <script src="../js/Vue.js"></script> <script> window.onload = function(){ var vm = new Vue({ el:'#box', data:{ show:'', list:['apple','bnanan','people','orange'], }, computed:{ lists(){ var arr=[]; this.list.forEach(function(val){ if(val.indexOf(this.show)!=-1){ arr.push(val); } }.bind(this)); return arr; } } }); } </script></head><body><div id="box"> <input type="text" v-model="show"> <transition-group enter-active-class="zoomInLeft" leave-active-class="zoomOutRight" > <p class="show_box animated" v-show="show" v-for="(val,index) in lists" :key="index" >{{val}}</p> </transition-group></div></body></html>
0 0
- vue2.0——运动
- vue2.0——生命周期
- vue2.0——循环
- vue2.0——组件
- vue2.0——路由
- vue2.0——管理组件通信
- vue2.0——v-model指令
- vue2.0——v-bind
- vue2.0—— Vue.directive
- vue2.0学习笔记 ——computed
- vue2.0学习笔记 ——methods
- vue2.0学习笔记 ——watch
- Vue2.0学习——生命周期
- Vue2.0项目开发流程—通俗易懂
- vue2.0项目快速搭建工具——vue-cli
- vue2.0学习——组件开发01
- vue2.0学习——组件开发02
- vue2.0学习——组件开发03
- ByteArrayInputStream:源:内存 ByteArrayOutputStream:目的:内存。
- java的echarts完整
- TCP和UDP代码示意
- Android如何监听第三方应用的启动
- 使用Rserve远程执行R脚本
- vue2.0——运动
- 捕捉信号SIGSEGV并回溯栈帧
- 9. Palindrome Number
- prettytensor 的使用
- Android开发--TableLayout中加载自写xml格式图形虚拟机上可显示,真机显示不了
- jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关
- LINUX core dump详解 & GDB调试
- cf369 B Chris and Magic Square
- 命令行执行java程序