<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动画钩子的更多相关文章

  1. Vue 动画的钩子函数

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. vue 生命周期钩子 路由钩子 动画钩子 执行顺序

    进入首页的钩子们 1 路由钩子 路由跳转前beforeEach 2 路由钩子 home组件内部:守卫执行前beforeRouteEnter 3.路由钩子 路由跳转后afterEach 4 生命周期 h ...

  3. 003 Vue动画

    一: 0.说明 在进入/离开的过渡中,会有 6 个 class 切换. v-enter:定义进入过渡的开始状态.在元素被插入之前生效,在元素被插入之后的下一帧移除. v-enter-active:定义 ...

  4. Vue动画操作

    概述 Vue 在插入.更新或者移除 DOM 时,提供多种不同方式的应用过渡效果.包括以下工具: 在 CSS 过渡和动画中自动应用 class 可以配合使用第三方 CSS 动画库,如 Animate.c ...

  5. vue动画的用法

    vue动画 在vue.js中有两种写动画的方法,第一种就是像js里一样,用原生代码来实现,第二种则是使用animate.css的动画类文件,这个动画类和bootstrap.css文件类似,直接调用类就 ...

  6. vue动画及其原理

    1,vue动画的实现原理,主要是通过在不同时期给需要动画的dom元素加上css动画样式 我们以显示和隐藏动画为例 a, 需要动画的dom元素 b,点击时vue控制往vue中加的样式 2,  我们以两张 ...

  7. Vue的钩子函数[路由导航守卫、keep-alive、生命周期钩子]

    前言 说到Vue的钩子函数,可能很多人只停留在一些很简单常用的钩子(created,mounted),而且对于里面的区别,什么时候该用什么钩子,并没有仔细的去研究过,且Vue的生命周期在面试中也算是比 ...

  8. vue教程3-02 vue动画

    vue教程3-02 vue动画 以下代码,已经用包管理器下载好vue,animate <!DOCTYPE html> <html lang="en"> &l ...

  9. vue动画实现方式

    vue动画实现方式 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset=&q ...

随机推荐

  1. Ubuntu 国内安装 kubernetes

    由于墙的原因,国内要安装 kubernetes 非常的麻烦,因此只要解决这个问题,就可以顺利安装 kubernetes 的 三个官法工具 kubelet.kubeadm.kubectl. 安装环境: ...

  2. TensorFlow 模型的保存与载入

    参考学习博客: # https://www.cnblogs.com/felixwang2/p/9190692.html 一.模型保存 # https://www.cnblogs.com/felixwa ...

  3. 排序算法大荟萃——希尔(Shell)排序算法

    1.基本思想:先取一个小于n的整数d1作为第一个增量,把文件的全部记录分成d1个组.所有距离为d1的倍数的记录放在同一个组中.先再各族中进行直接插入排序,然后取第二个增量d2<d1重复上述的分组 ...

  4. Java补强转

    /* 对于byte/short/char三种类型来说,如果右侧赋值的数值没有超过范围, 那么javac编译器将会自动隐含地为我们补上一个(byte)(short)(char). 1. 如果没有超过左侧 ...

  5. gitlab的搭建与汉化

    gitlab的搭建:内存最好2G以上 yum -y install curl unzip policycoreutils git wget         安装相关依赖包 所有gitlab rpm包的 ...

  6. disconf---分布式配置管理平台的搭建(windows版本)

    本人由刚开始接触博客,难免会有不足和错误,写博客只是记录本人在学习和工作的过程中的成长,如有不足,欢迎各位指正,谢谢~ 一.废话不多说,直接进入正题: ①获取github代码 https://gith ...

  7. tp5的输入和验证

    规则和模板 好像要写一样名字,只需要引入模板

  8. JDBC 通过读取文件进行初始化

  9. java.io包中的四个抽象类

    IO所谓的四大抽象类就是:  InputStream.OutputStream.Reader.Writer

  10. 激活win10企业版,亲测可用,(win7步骤相同,请自行测试)

    其他版本我没试过,亲们可以尝试! win7神key win7神key1:2HYJ4-V71WM-BAF6Y-G2BTH-X8QOD win7神key2:9LM54-Z3LQ1-5IRAN-T4JNI- ...