先上几个链接

vue插件大集合:awesome-vue 
vue2插件: vue2-animate:vue2-animate 
vue2插件vue2-animateDEMO: vue2-animatedemo:vue2-animate-demo

我想用过animatecss的都知道这是一个极其简单而又酷炫的css动画库,但是我想在vue2中使用animatecss却是很麻烦的事。 
其实vue的官网上在使用过度的时候就说过和animate配合很好什么的bulabula,但是要是用的话也好麻烦,还要自己根据过度类名的写法写css,或者绑定一堆属性, 
但是但是,今天翻awesome-vue的时候正好看到有这么个插件:vue2-animate正好符合我们的需求

vue2-animate

这个插件呢是个纯css库,只是简单地将原来的animate的动画类名写成了可以被vue的过渡标签直接使用的类名了。虽然仅仅是如此就极大地方便了我们的使用。

使用vue2-animate

其实直接看他的github就非常快了 
这里简单地复述一遍

安装

安装的方式有很多种 
1> 在html文件中直接引用从github上下载的资源

 <link rel="stylesheet" href="vue2-animate.min.css">

2>如果使用webpack并且用对了css-loader可以使用npm 安装 
npm安装包依赖

npm install --save vue2-animate

在main.js中引用

require('vue2-animate/dist/vue2-animate.min.css')
或者
import 'vue2-animate/dist/vue2-animate.min.css';

3>使用less

@import "<PATH_TO_SOURCE>/src/vue2-animate.less";

4>使用构建器编译

git clone https://github.com/asika32764/vue2-animate.git
cd vue2-animate
npm install
npm run build #Compiled .css files go to the dist folder

使用

1>基本的使用就是在过度元素上使用对应的name属性

<transition-group name="fadeLeft" tag="ul">
<li v-for="item in items" v-bind:key="item">
{{ item }}
</li>
</transition-group>

2>使用不同的载入载出动画 
》》》第一种:使用custom-classes-transition,需要在不同的载入载出动画上加-enter和-leave后缀

<transition
name="custom-classes-transition"
enter-active-class="bounceLeft-enter"
leave-active-class="bounceRight-leave"
>
<p v-if="show">hello</p>
</transition>

》》》第二种:使用in/out类名在动画名后面加上In或者Out

<transition
name="bounce"
enter-active-class="bounceInLeft"
leave-active-class="bounceOutRight"
>
<p v-if="show">hello</p>
</transition>

现在支持的动画

Bounce

bounce
bounceDown
bounceLeft
bounceRight
bounceUp
Fade fade
fadeDown
fadeDownBig
fadeLeft
fadeLeftBig
fadeRight
fadeRightBig
fadeUp
fadeUpBig rotate
rotateDownLeft
rotateDownRight
rotateUpLeft
rotateUpRight
Slide slideDown
slideLeft
slideRight
slideUp
Zoom zoom
zoomDown
zoomLeft
zoomRight
zoomUp

vue2使用animate css的更多相关文章

  1. vue2借助animate.css实现路由动画效果

    第一步: npm install animate.css --save 第二步:打开main.js import animate from 'animate.css' Vue.use(animate) ...

  2. vue2+animate.css

    下载animate.css并引入项目, import './css/animate.css'使用: <template> <div class="box"> ...

  3. vue2.0-transition配合animate.css

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

  4. vue2.0和animate.css的结合使用

    animate.css是一款前端动画库,相似的有velocity-animate. 上述是一个完整的结构.其中重要的几个点用箭头表示出来.首先在transition组件内部,需要定义两个基本的clas ...

  5. vue 结合 animate.css

    这里说的是vue2.0和animate.css的结合使用.其实用过就知道用法是比较简单的.但是就是刚开始使用的时候,难免有的会遇到各种问题.简单的说说我所用过并且遇过的坑. 首先是transition ...

  6. animate.css(第三方动画使用方法)

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #a5b2b9 } animation 语法: animatio ...

  7. css3动画简介以及动画库animate.css的使用

    在这个年代,你要是不懂一点点css3的知识,你都不好意思说你是个美工.美你妹啊,请叫我前端工程师好不好.呃..好吧,攻城尸...呵呵,作为一个攻城尸,没有点高端大气上档次的东西怎么能行呢,那么css3 ...

  8. 使用CSS3动画库animate.css

    IE9及更早版本的IE浏览器都不支持css3动画 谷歌浏览器.火狐浏览器.IE10+浏览器以及移动端浏览器等这些都支持css3动画 animate.css内置了很多典型的css3动画   用法   1 ...

  9. 动画库Animate.css

    笔记分享: 用法:到官网(http://daneden.github.io/animate.css/),下载animate.min.css文件.点击这里 1.首先引入animate css文件 < ...

随机推荐

  1. Angular中依赖注入方式的几种写法

    1.第一种写法 angular.module('App').controller('TestCtrl',['$scope', function($scope) {}]); 2.第二种写法 angula ...

  2. unite2017相关

    日程 http://unite2017.csdn.net/ http://www.sohu.com/a/137202360_280780 http://www.gameres.com/750046.h ...

  3. 洛谷P1220 关路灯(区间dp)

    关路灯 某一村庄在一条路线上安装了n盏路灯,每盏灯的功率有大有小(即同一段时间内消耗的电量有多有少).老张就住在这条路中间某一路灯旁,他有一项工作就是每天早上天亮时一盏一盏地关掉这些路灯.为了给村里节 ...

  4. IT兄弟连 JavaWeb教程 监听器3

    监听域对象中属性变更的监听器 域对象中属性的变更的事件监听器就是用来监听ServletContext.HttpSession.HttpServletRequest这三个对象中的属性变更信息事件的监听器 ...

  5. 剑指Offer的学习笔记(C#篇)-- 栈的压入、弹出序列

    题目描述 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压 ...

  6. 获取所有bean的名字

    import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.facto ...

  7. spring tx:advice事务配置

    http://blog.csdn.net/bao19901210/article/details/17226439 http://blog.csdn.net/rong_wz/article/detai ...

  8. Ocelot实现API网关服务

    NET Core微服务之基于Ocelot实现API网关服务 https://www.cnblogs.com/edisonchou/p/api_gateway_ocelot_foundation_01. ...

  9. 079 Word Search 单词搜索

    给定一个二维面板和一个单词,找出该单词是否存在于网格中.这个词可由顺序相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格.同一个单元格内的字母不允许被重复使用.例如,给定 二 ...

  10. node.js安装Oracledb指导文档

    https://community.oracle.com/docs/DOC-931127