制作目标动画:向上入场添加数据,点击数据右滑动离场

简单页面效果:

实现代码如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/animate.css"/>
<script type="text/javascript" src="js/vue.js" ></script>
<style type="text/css">
.box li{
width: 300px;
line-height: 30px;
margin: 5px;
padding: 0 10px;
border: 1px dashed royalblue;
list-style: none;
}
.box li:hover{
background-color: royalblue;
color: #fff;
cursor: pointer;
}
</style>
</head>
<body>
<div id="app">
id: <input type="text" v-model="id"/>
name: <input type="text" v-model="name"/>
<button @click="add">添加</button>
<ul class="box">
<transition-group enter-active-class="animated slideInUp" leave-active-class="animated slideOutRight" >
<li v-for="item in list" :key="item.id" @click="del(item.id)">{{item.name}}</li>
</transition-group>
</ul> </div>
<script type="text/javascript">
var vm = new Vue({
el:'#app',
data:{
list:[
{id:1,name:'xiaoxiao'},
{id:2,name:'maomao'},
{id:3,name:'dada'},
{id:4,name:'hehe'},
],
id:'',
name:''
},
methods:{
add(){
this.list.push({id:this.id,name:this.name})
},
del(id){
var index = this.list.findIndex(function(item){
return item.id == id
})
this.list.splice(index,1)
}
}
})
</script>
</body>
</html>

vue animate.css训练动画案例 列表循环的更多相关文章

  1. vue中使用第三方插件animate.css实现动画效果

    vue中使用第三方插件animate.css实现动画效果1.首先先引入第三方类animated.css2.将你所需要动画的标签用包裹起来3.在transition元素中添加enter-active-c ...

  2. CSS--使用Animate.css制作动画效果

    一 使用Animate.css动画 // 通过@import引入外部CSS资源; // 引入线上图片及JS文件; // 通过更改CSS类名生成不同类型的CSS3动画;   <!DOCTYPE h ...

  3. Animate.css 前端动画开发教程

    1.首先下载animate.css文件: 2.打开动画预览地址选择想要的动画,地址:https://daneden.github.io/animate.css/  ,选择好后记住动画的名字在你下载的a ...

  4. vue中使用animate.css实现动画

    参考链接:https://www.cnblogs.com/ccyinghua/p/7872694.html 参考链接:https://www.jianshu.com/p/2e0b2f8d40cf 使用 ...

  5. vue.js(10)--案例--列表增加与删除

    品牌管理案例 (1)bootstrip快速布局 <div class="app"> <div class="panel panel-primary&qu ...

  6. vue中使用transition和animate.css动画效果

    一.单个动画中,使用div中引用animate动画 1.下载依赖 npm install animate.css –save 2.main.js中全局引用 import animate from 'a ...

  7. 基于animate.css动画库的全屏滚动小插件,适用于vue.js(移动端、pc)项目

    功能简介 基于animate.css动画库的全屏滚动,适用于vue.js(移动端.pc)项目. 安装 npm install vue-animate-fullpage --save 使用 main.j ...

  8. JQuery插件之Animate.css和 jquery-aniview

    Animate.css 一款强大的预设css3动画库 简介 animate.css 是一个来自国外的 CSS3 动画库,它预设了抖动(shake).闪烁(flash).弹跳(bounce).翻转(fl ...

  9. vue使用animate.css类库实现动画

    首先安装animate.css类库 cnpm install animate.css –save 然后在vue的script文件中引用 import $ from '../assets/js/jque ...

随机推荐

  1. 单元测试-xUnit总结

    xUnit总结 什么是xUnit xUnit.net是针对.NET Framework的免费,开源,以社区为中心的单元测试工具. 自动化测试的优点 可以频繁的进行测试 可以在任何时间进行测试,也可以按 ...

  2. 进阶之路 | 奇妙的Animation之旅

    前言 本文已经收录到我的Github个人博客,欢迎大佬们光临寒舍: 我的GIthub博客 学习清单: 动画的种类 自定义View动画 View动画的特殊使用场景 属性动画 使用动画的注意事项 一.为什 ...

  3. C#设置自定义文件图标实现双击启动

    修改注册表,双击文件直接打开 string strProject = "Exec"; string p_FileTypeName =".cdb";//文件后缀 ...

  4. Girlfreind:1 Vulnhub Walkthrough

    靶机链接: https://www.vulnhub.com/entry/me-and-my-girlfriend-1,409/ 主机扫描: HTTP 目录访问,提示无权限,右键源码,提示XXF即可 正 ...

  5. Linux如何定位文件在磁盘的物理位置

    我在学习研究Linux内核结构的时候,思考过一个问题:Linux如何定位文件在磁盘的物理位置每个文件都有一个inode,inode在内核代码中的数据结构如下: 1 struct ext4_inode ...

  6. PMP--1.7 项目治理

    治理凌驾于管理之上 组织治理用于影响项目治理. 组织治理需要组织根据组织文化.项目类型和组织需求裁剪治理框架,适用于当前组织. 其实组织治理的内容,在项目管理初期不需要详细了解,组织治理的内容都是高层 ...

  7. springCloud进阶(微服务架构&Eureka)

    springCloud进阶(微服务架构&Eureka) 1. 微服务集群 1.1 为什么要集群 为了提供并发量,有时同一个服务提供者可以部署多个(商品服务).这个客户端在调用时要根据一定的负责 ...

  8. 02-flink时间语义 与 Window 基础概念与实现原理

    Flink 多种时间语义对比 Flink 在流应用程序中支持不同的 Time 概念,就比如有 Processing Time.Event Time 和 Ingestion Time.下面我们一起来看看 ...

  9. qt creator源码全方面分析(2-9)

    目录 Semantic Highlighting 通用高亮 高亮和折叠块 Semantic Highlighting Qt Creator将C++,QML和JavaScript语言理解为代码,而不是纯 ...

  10. 【第一篇】为什么选择xLua

    为什么选择xLua 1. 易用性 Unity全平台补丁技术,可以运行时把C#实现(方法.操作符.属性.事件.构造函数)替换为lua的实现 自定义struct,枚举在lua和C#之间传递无C#的gc a ...