vue动画钩子
<template>
<div class="hello">
<div class="toggle" @click="fullScreen = !fullScreen" v-show="fullScreen">toggle</div>
<transition name="normal"
@enter="enter"
@after-enter="afterEnter"
@leave="leave"
@after-leave="afterLeave">
<div class="middle" v-show="fullScreen">
<div class="middle-l">
<div class="cd-wrapper">
<div class="cd">
<img class="image" src="./s.jpg">
</div>
</div>
</div>
</div>
</transition>
<div v-show="!fullScreen" @click="fullScreen = !fullScreen" class="mini">mini</div>
</div>
</template> <script>
export default {
name: 'HelloWorld',
data () {
return {
show: true,
fullScreen: true
}
},
methods: {
enter(el, done) {
console.log('enter')
done()
},
afterEnter() {
console.log('afterEnter')
},
leave(el, done) {
console.log('leave')
done()
},
afterLeave() {
console.log('afterLeave')
},
}
}
</script> <style lang="stylus" scoped>
.hello
position fixed
bottom
top
left
right
text-align center
line-height
font-size
background pink
.middle
position absolute
top 40px
bottom 40px
right
left
background #4d4446
&.normal-enter-active, &.normal-leave-active
transition: all .3s
&.normal-enter, &.normal-leave-to
transform: translate3d(%, , )
opacity
.middle-l
display inline-block
vertical-align top
position relative
width %
height
padding-top %
.cd-wrapper
position absolute
left %
top
width %
height %
box-sizing border-box
.cd
width %
height %
border-radius %
.image
position absolute
left
top
width %
height %
box-sizing border-box;
border-radius %
border 10px solid rgba(, , , 0.1)
.toggle
width %
height 40px
background #eee
border none
line-height 40px
font-size 14px
.mini
position absolute
bottom
width %
height 40px
border none
line-height 40px
background #eee
font-size 14px
</style>
vue动画钩子的更多相关文章
- Vue 动画的钩子函数
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- vue 生命周期钩子 路由钩子 动画钩子 执行顺序
进入首页的钩子们 1 路由钩子 路由跳转前beforeEach 2 路由钩子 home组件内部:守卫执行前beforeRouteEnter 3.路由钩子 路由跳转后afterEach 4 生命周期 h ...
- 003 Vue动画
一: 0.说明 在进入/离开的过渡中,会有 6 个 class 切换. v-enter:定义进入过渡的开始状态.在元素被插入之前生效,在元素被插入之后的下一帧移除. v-enter-active:定义 ...
- Vue动画操作
概述 Vue 在插入.更新或者移除 DOM 时,提供多种不同方式的应用过渡效果.包括以下工具: 在 CSS 过渡和动画中自动应用 class 可以配合使用第三方 CSS 动画库,如 Animate.c ...
- vue动画的用法
vue动画 在vue.js中有两种写动画的方法,第一种就是像js里一样,用原生代码来实现,第二种则是使用animate.css的动画类文件,这个动画类和bootstrap.css文件类似,直接调用类就 ...
- vue动画及其原理
1,vue动画的实现原理,主要是通过在不同时期给需要动画的dom元素加上css动画样式 我们以显示和隐藏动画为例 a, 需要动画的dom元素 b,点击时vue控制往vue中加的样式 2, 我们以两张 ...
- Vue的钩子函数[路由导航守卫、keep-alive、生命周期钩子]
前言 说到Vue的钩子函数,可能很多人只停留在一些很简单常用的钩子(created,mounted),而且对于里面的区别,什么时候该用什么钩子,并没有仔细的去研究过,且Vue的生命周期在面试中也算是比 ...
- vue教程3-02 vue动画
vue教程3-02 vue动画 以下代码,已经用包管理器下载好vue,animate <!DOCTYPE html> <html lang="en"> &l ...
- vue动画实现方式
vue动画实现方式 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset=&q ...
随机推荐
- 神经网络之反向传播算法(BP)公式推导(超详细)
反向传播算法详细推导 反向传播(英语:Backpropagation,缩写为BP)是"误差反向传播"的简称,是一种与最优化方法(如梯度下降法)结合使用的,用来训练人工神经网络的常见 ...
- 【Hibernate 检索策略】
HibernateDemo2 public class HibernateDemo2 { //演示批量抓取 @Test public void testSelect3() { SessionFacto ...
- IDEA 导出可执行jar包【转载】
1,在项目上鼠标右键 --> Open Module Settings,或者[shift+ctrl+alt+s] 2, Artifacts --> + --> JAR --> ...
- P1067
这题没什么好说的,就是判断,需要考虑仔细一点. AC代码: #include <bits/stdc++.h> using namespace std; const int N = 712; ...
- nginx 配置Tp5项目时出现 404 Not Found nginx
1.首先看了nginx报错日志 报 signal process started signal process started表示还有 产生原因 1.可能你的nginx.conf 内容配置的有问题. ...
- Git基础及进阶-系统总结
Git基础及进阶-系统总结 by 小强 2019-07-01 考虑到入职后不仅需要熟练掌握git的基本使用,在企业实际操作中还涉及一些进阶指令.作为一个程序员,熟练使用工具是一项基本技能,也是程序员的 ...
- jquery--获取多选框的值、获取下拉多选框的值
获取多选框的值 var packageCodeList=new Array(); $('#server_id:checked').each(function(){ packageCodeList.pu ...
- Node.js 服务端处理图片
Node 服务端处理图片 服务端进行图片处理是很常见的需求,但是Node在这一块相对来说比较薄弱.找了几个比较常见的模块来解决问题. gm GraphicsMagick for node 使用Open ...
- python opencv:使用滑动条做调色板
cv2.getTrackbarPos() 函数的 一个参数是滑动条的名字, 第二个参数是滑动条被放置窗口的名字, 第三个参数是滑动条的默认位置. 第四个参数是滑动条的最大值, 第五个函数是回调函数,每 ...
- springboot2.x整合redis
pom文件 <!--springboot中的redis依赖--> <dependency> <groupId>org.springframework.boot< ...