zoukankan      html  css  js  c++  java
  • Vue 结合 Animate.CSS 实现简单动画效果

    我们在做项目的时候,对于一些页面元素如果能添加一些动画效果,那肯定是非常 炫酷 的,今天介绍一个第三方动画库 —— Animate.css .

    用法很简单,不过新手容易踩坑。注意,前提是你的 计算机 高级系统设置里,性能选项里 选择 “调整为最佳外观” 即可。

    一、在 <head> </head> 中引入 Animate.CSS :

    <head>
    <link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
    />
    </head>

    二、HTML 部分:

    <div id="example-1">
      <button @click="show = !show">Toogle</button>
      
      <transition
        enter-active-class="animate__animated animate__backInDown"
        leave-active-class="animate__animated animate__bounceOutDown"
      >
        <div v-show="show">
          Hello
        </div>
      </transition>
    </div>

    三、Script 部分:

    var app = new Vue({
      el: '#example-1',
      data: {
        show: true,
      }
    })

    此时,动画效果已经可以展示啦:

  • 相关阅读:
    Docker镜像和容器
    Docker介绍
    Ansible实战:部署分布式日志系统
    Ansible之roles介绍
    Ansible之tags介绍
    Ansible之迭代、模板
    linux jenkins安装(四)
    linux maven安装(三)
    linux tomcat安装(二)
    linux JDK安装(一)
  • 原文地址:https://www.cnblogs.com/Fcode-/p/14957227.html
Copyright © 2011-2022 走看看